protected void gvSchemeDetails_ItemCommand(object source, GridCommandEventArgs e) { int strSchemePlanCode = 0; int Isonline = 0; string strExternalCode = string.Empty; string strExternalType = string.Empty; DateTime createdDate = new DateTime(); DateTime editedDate = new DateTime(); DateTime deletedDate = new DateTime(); if (e.CommandName == RadGrid.UpdateCommandName) { strExternalCodeToBeEdited = Session["extCodeTobeEdited"].ToString(); CustomerBo customerBo = new CustomerBo(); bool isUpdated = false; GridEditableItem gridEditableItem = (GridEditableItem)e.Item; TextBox txtExtCode = (TextBox)e.Item.FindControl("txtExternalCodeForEditForm"); DropDownList txtExtType = (DropDownList)e.Item.FindControl("ddlExternalType"); TextBox txtSchemePlancode = (TextBox)e.Item.FindControl("txtSchemePlanCodeForEditForm"); DropDownList ddlIsonline = (DropDownList)e.Item.FindControl("ddlONline"); strSchemePlanCode = int.Parse(txtSchemePlancode.Text); strExternalCode = txtExtCode.Text; strExternalType = txtExtType.Text; Isonline = Convert.ToInt32(ddlIsonline.Text.ToString()); editedDate = DateTime.Now; int count = customerBo.ToCheckSchemeisonline(strSchemePlanCode, Isonline, strExternalCode); if (count > 0) { ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "MyScript", "alert('this scheme is allready onlline!!');", true); return; } //isUpdated = false; isUpdated = customerBo.EditProductAMCSchemeMapping(strSchemePlanCode, strExternalCodeToBeEdited, strExternalCode, Isonline, strExternalType, createdDate, editedDate, deletedDate, userVo.UserId); } if (e.CommandName == RadGrid.DeleteCommandName) { bool isDeleted = false; customerBo = new CustomerBo(); GridDataItem dataItem = (GridDataItem)e.Item; TableCell strSchemePlanCodeForDelete = dataItem["PASP_SchemePlanCode"]; TableCell strSchemePlanNameForDelete = dataItem["PASP_SchemePlanName"]; TableCell StrExternalCodeForDelete = dataItem["PASC_AMC_ExternalCode"]; TableCell strExternalTypeForDelete = dataItem["PASC_AMC_ExternalType"]; strSchemePlanCode = int.Parse(strSchemePlanCodeForDelete.Text); strExternalCode = StrExternalCodeForDelete.Text; strExternalType = strExternalTypeForDelete.Text; deletedDate = DateTime.Now; isDeleted = customerBo.DeleteMappedSchemeDetails(strSchemePlanCode, strExternalCode, strExternalType, createdDate, editedDate, deletedDate); } if (e.CommandName == RadGrid.PerformInsertCommandName) { CustomerBo customerBo = new CustomerBo(); bool isInserted = false; GridEditableItem gridEditableItem = (GridEditableItem)e.Item; TextBox txtExtCode = (TextBox)e.Item.FindControl("txtExternalCodeForEditForm"); DropDownList txtExtType = (DropDownList)e.Item.FindControl("ddlExternalType"); TextBox txtSchemePlancode = (TextBox)e.Item.FindControl("txtSchemePlanCodeForEditForm"); TextBox txtSchemePlanName = (TextBox)e.Item.FindControl("txtSchemePlanNameForEditForm"); strSchemePlanCode = int.Parse(txtSchemePlancode.Text); strExternalCode = txtExtCode.Text; strExternalType = txtExtType.Text; createdDate = DateTime.Now; isInserted = customerBo.InsertProductAMCSchemeMappingDetalis(strSchemePlanCode, strExternalCode, strExternalType, createdDate, editedDate, deletedDate); } BindSchemePlanDetails(); }