Wednesday, 28 February 2018

Generate HTML control using Razor

Generate HTML control using Razor

MVC Razor is a powerful technique to generate HTML controls. So I have created this post to demonstrate you to how can you generate simple HTML controls using razor code.

Textbox

Razor        

@Html.TextBox("Test",null, new { placeholder=@Model.FullName, @class = "form-control",@onclick="test()" })

Generated Code

Monday, 26 February 2018

Delete Record MVC Ajax



Target User

Beginner He/She learning MVC and want to delete a record by clicking on delete button on table row.

Table Stucture


Field
Data Type
Roll
Bigint
Name
Varchar(20)
City
Varchar(20

Model

public class StudentModel
{
    public int Roll { get; set; }
    public string Name { get; set; }

    public string City { get; set; }
}

Controller

//Show Record Page
public ActionResult ShowData()

Saturday, 24 February 2018

Plane C Graphics


Plane C Graphics





/*==============================
      Girfa Student Help
      Program :Plane C Graphics
      More Program :http://girfahelp.blogspot.in/p/graphics-c-language.html
================================*/
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <dos.h>
void drawplane(int);
int main(void)
{
   /* request auto detection */
   int gdriver = DETECT, gmode, error

Record Update ajax MVC


Field
Data Type
Roll
Bigint
Name
Varchar(20)
City
Varchar(20
Table Structure 1



Store Procedure

USE [Girfa_Studb]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER proc [dbo].[UpdateProduct]
(
@roll bigint,
@name varchar(100),
@city varchar(100)

)

Friday, 23 February 2018

Save Data MVC Ajax

Target audience

Beginners learning MVC and want to save a from record into database using ajax.

Table Structure

Roll
Bigint
Name
Varchar(20)
City
Varchar(20)

Store Procedure

USE[Girfa_DB]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTERProc[dbo].[AddRecord]
(
@rollbigint,
@namevarchar(20),
@cityvarchar(20)
)
AS

BEGIN
       SETNOCOUNTON;
              INSERTintoStudent(roll,Name,City)values(@roll,@name,@city)
       SETNOCOUNTOFF;
END

Model


publicclassStudentModel
{
publicint Roll { get; set; }
publicstring Name { get; set; }

Wednesday, 21 February 2018

Data Render Using Razor

Display Student Record on cshtml page in table using Razor


@model IEnumerable<Britanic_MIS.Models.InvoiceModel>
<table >
        <thead>
            <tr><th>Roll</th><th>Name</th><th>City</th></tr>
        </thead>
        <tbody >
                 
                @foreach (var item in Model)
                {

MVC Data Reader with Razor


Store Procedure


USE [Girfa_StudentDB]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
alter proc [dbo].[GetStudentList]
AS
BEGIN
     SET NOCOUNT ON;
           select roll,name,city from dbo.Student

     SET NOCOUNT OFF;
END


Model


public class StudentModel

Saturday, 17 February 2018

OSI Layer C Graphics

OSI Layer C Graphics

Amazing OSI layer animation using c language graphics programming 




/*==============================
     Girfa Student Help
     Program : OSI Layer Using C Graphics
     More Program : http://girfahelp.blogspot.in/p/graphics-c-language.html
     Coder : Mayank Khare,BCA
================================*/
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#define x 1000
int main(void)
{
   /* request auto detection */
   int gdriver = DETECT, gmode, errorcode;
   int xmax, ymax,i;

   /* initialize graphics and local variables */
   initgraph(&gdriver, &gmode, "");

   /* read result of initialization */
   errorcode = graphresult();

Friday, 16 February 2018

Get Data from server MVC C# ajax application

$ajax({
    url: '/Student/Show/',
    dataType: "json",
    type: "GET",
    contentType: 'application/json; charset=utf-8',
    data: { id: $("#txtroll").val() },
    success: function (data) {
        var html="";
            $j.each(data, function (i, item) {

                html += "<tr><td>" + item.roll + "</td><td>" + item.Name + "</td><td>" + item.city + "</td></tr>";
                     

Date parameter as dd/mm/yyyy

USE [Girfa_StudentHelp]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create proc [dbo].[StuReport]
(
@d1 varchar(100),
@d2 varchar(100)
)
AS
BEGIN

Saturday, 10 February 2018

India Gate C Graphics

India Gate using C language graphics programming 


India Gate using C language graphics programming

Code : 


/*==============================
     Girfa Student Help
     Program : India Gate
     More Program : http://girfahelp.blogspot.in/p/graphics-c-language.html
     coder : Maynak Khare
     Email : khare.mayank09@gmail.com
================================*/
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#define x 100
int main(void)
{
   /* request auto detection */
   int gdriver = DETECT, gmode, errorcode;
   int maxx, maxy,i,j;

   /* our polygon array */
   int poly[10];

Animated circle c graphics






/*==============================
     Girfa Student Help
     Program : Animated circle
     More Program :http://girfahelp.blogspot.in/p/graphics-c-language.html
================================*/

#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <dos.h>
int main(void)
{
   /* request auto detection */
   int gdriver = DETECT, gmode, errorcode;
   int midx, midy;
   int radius = 100;

Fill Drop down list using razor

Store Procedure


USE [Girfa_ProductDB]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[fetchProduct]
AS
BEGIN
     select  id,productname from dbo.product order by productname
END


CHTML

@model IEnumerable<Britanic_MIS.Models.ProductModel>

Product : 
<select class="form-control