protected void grid_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ASPxGridView grid = sender as ASPxGridView; DataTable table = grid.DataSource as DataTable; /*if (Convert.ToInt32(Request.QueryString["id"].ToString()) > 0) * { * ProductPriceItems PPI = new ProductPriceItems(); * table = PPI.getByProductID(Convert.ToInt32(Request.QueryString["id"].ToString())); * DataColumn colid = table.Columns[0]; * table.PrimaryKey = new DataColumn[] { colid }; * } * else * { * table = GetTable(); * }*/ DataColumn colid = table.Columns[0]; table.PrimaryKey = new DataColumn[] { colid }; DataRow found = table.Rows.Find(e.Keys["ID"]); found["TeacherName"] = e.NewValues["TeacherName"]; /*found["Amount"] = e.NewValues["Amount"]; * found["Seq"] = e.NewValues["Seq"]; * found["GLAccountID"] = e.NewValues["GLAccountID"]; */ Session["Table"] = table; grid.DataSource = table; grid.DataBind(); string sql = "select ID as TeacherID,Name as TeacherName from Std_Teacher "; DataTable dt = DataAccess.ExecuteSQLQuery(sql); GridViewDataComboBoxColumn regioncolumn = (ASPxGridView1.Columns["clTeacher"] as GridViewDataComboBoxColumn); regioncolumn.PropertiesComboBox.DataSource = dt; regioncolumn.PropertiesComboBox.ValueField = "TeacherID"; regioncolumn.PropertiesComboBox.TextField = "TeacherName"; e.Cancel = true; grid.CancelEdit(); }
protected void O365ServerGridView_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { O365Server O365ServerObject = new O365Server(); //11/19/2013 NS modified //URLObject.TheURL = (e.Keys[0]).ToString(); O365ServerObject.ID = (e.Keys[0]).ToString(); DataTable o365data = VSWebBL.ConfiguratorBL.O365ServerBL.Ins.Get((e.Keys[0]).ToString()); string name = o365data.Rows[0]["Name"].ToString(); O365ServerObject.Name = name; //Delete row from DB Object ReturnValue = VSWebBL.ConfiguratorBL.O365ServerBL.Ins.DeleteData(O365ServerObject); //Update Grid after inserting new row, refresh grid as in page load ASPxGridView gridView = (ASPxGridView)sender; gridView.CancelEdit(); e.Cancel = true; FillO365ServerGrid(); }
protected void MobUserThGrid_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { try { object ReturnValue = VSWebBL.ConfiguratorBL.MobileUsersBL.Ins.DeleteThresholdData(e.Keys[0].ToString()); ASPxGridView gridview = (ASPxGridView)sender; gridview.CancelEdit(); e.Cancel = true; FillMobileDevicesGrid(); //Response.Redirect("MobileUsersGrid.aspx"); } catch (Exception ex) { //Log.Entry.Ins.Write(Server.MapPath("~/LogFiles/"), "VSPlusLog.txt", DateTime.Now.ToString() + " Error in Page: " + // Request.Url.AbsolutePath + ", Method: " + System.Reflection.MethodBase.GetCurrentMethod().Name + // ", Error: " + ex.ToString()); //6/27/2014 NS added for VSPLUS-634 Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); } }
protected void gridEvaluation_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ASPxGridView gridEvaluation = (ASPxGridView)sender; var user = HttpContext.Current.Session["UserEmail"].ToString(); String ItemID = Session["CriteriaId"].ToString(); ResponseEvaluation re = new ResponseEvaluation(); re.ItemID = Guid.Parse(ItemID); re.ReviwerDate = DateTime.Parse(e.NewValues["eval_date"].ToString()); // re.ReviwerBy = e.NewValues["eval_by"].ToString(); re.ReviwerBy = user; re.ReviwerComments = e.NewValues["eval_description"].ToString(); re.ReviwerAssessment = e.NewValues["eval_reviewer_assessments"].ToString(); rc_services.InsertNewEvaluation(re); e.Cancel = true; gridEvaluation.CancelEdit(); }
public void DetectorVoting_Deleting(object sender, ASPxDataDeletingEventArgs e) { SqlCommand cmd; ASPxGridView detailGridView = (ASPxGridView)sender; string Selected_OBID = e.Keys[Detector_Grid.KeyFieldName].ToString(); string qry = " UPDATE TBLDETECTOR_VOTING SET N1TERMINATIONDATE = REPLACE(REPLACE(CONVERT(varchar(23), GETDATE(), 121), '-','/'),' ', '-'), "; qry = qry + "N1TERMINATIONSESID = '" + SessionInfo.UserID + "' "; qry = qry + "WHERE OBID = '" + Selected_OBID + "' "; cmd = new SqlCommand(qry, fgm_moduler.func_Class.conn); cmd.ExecuteNonQuery(); e.Cancel = true; Detector_Grid.CancelEdit(); detailGridView.CancelEdit(); //Detector_Grid.CancelEdit(); }
protected void gvClients_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { dsData = Session["ClientData"] as DataSet; ASPxGridView gridView = sender as ASPxGridView; DataTable dataTable = dsData.Tables[0]; DataRow row = dataTable.Rows.Find(e.Keys[0]); e.NewValues["ClientId"] = new Guid(); e.NewValues["UpdatedBy"] = Master.LoggedUser.UserId.Value; IDictionaryEnumerator enumerator = e.NewValues.GetEnumerator(); enumerator.Reset(); while (enumerator.MoveNext()) { row[enumerator.Key.ToString()] = enumerator.Value == null ? DBNull.Value : enumerator.Value; } gridView.CancelEdit(); e.Cancel = true; Session["ClientData"] = dsData; }
protected void GridListagem_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { ASPxGridView gridView = (ASPxGridView)sender; uReceitas.ExcluiReceita(e.Values["ID"].ToString()); // gridView.CancelEdit(); e.Cancel = true; //Usando Classe uLog.MakeLog - Gravando Log fwObs_Log = "EXCLUI CLASSE RECEITAS: " + e.Values["codigo"].ToString() + "/" + e.Values["descricao"].ToString().ToUpper(); SqlParameter[] param_log = { new SqlParameter("@login", (String)Session["CodUsuario"]), new SqlParameter("@tabela", fWtabela), new SqlParameter("@operacao", "CLASSE RECEITAS"), new SqlParameter("@obs", "EXCLUI"), new SqlParameter("@acao", fwObs_Log) }; uLog.MakeLog(param_log); // AtualizaGrid(); }
protected void DELSGridView_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { //5/10/2016 Sowjanya modified for VSPLUS-2939 try { DataTable Htable = Session["DELStable"] as DataTable; DataRow[] dr = Htable.Select("ID=" + Convert.ToInt32(e.Keys[0])); foreach (DataRow r in dr) { r.Delete(); r.AcceptChanges(); } LogFile LocObject = new LogFile(); LocObject.ID = Convert.ToInt32(e.Keys[0]); int id = Convert.ToInt32(e.Keys[0]); Session["DELStable"] = Htable; if (Session["key"] != null) { Session["key"] += "," + id.ToString(); } else { Session["key"] += id.ToString(); } ASPxGridView gridview = (ASPxGridView)sender; gridview.CancelEdit(); e.Cancel = true; } catch { } }
protected void gvDepartures_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { dsData = Session[Constants.SESSION_DEPARTURES] as DataSet; ASPxGridView gridView = sender as ASPxGridView; DataTable dataTable = dsData.Tables[0]; DataRow row = dataTable.Rows.Find(e.Keys[0]); e.NewValues["UpdatedUser"] = Master.LoggedUser.UsersId; IDictionaryEnumerator enumerator = e.NewValues.GetEnumerator(); enumerator.Reset(); while (enumerator.MoveNext()) { row[enumerator.Key.ToString()] = enumerator.Value == null ? DBNull.Value : enumerator.Value; } gridView.CancelEdit(); e.Cancel = true; if (new ReservationManagement.ReservationRoom().UpdateDashboardArrivalsDepartures(dsData)) { if (row["IsDirty"] != null && Boolean.Parse(row["IsDirty"].ToString()) != false) { new RoomDAO().UpdateRoomAsDirty(new Room() { RoomId = (int)row["RoomId"], UpdatedUser = Master.LoggedUser.UsersId }); } System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "ShowMessage", "javascript:ShowSuccessMessage('" + Messages.Save_Success + "')", true); if (dtpDeparturesFrom.Value != null && dtpDeparturesTo.Value != null) { LoadDepartures(dtpDeparturesFrom.Date, dtpDeparturesTo.Date); } } else { System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "ShowMessage", "javascript:ShowSuccessMessage('" + Messages.Save_Unsuccess + "')", true); } }
protected void LocationsGridView_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { Locations LocObject = new Locations(); LocObject.ID = Convert.ToInt32(e.Keys[0]); //Delete row from DB String ReturnValue = VSWebBL.SecurityBL.LocationsBL.Ins.DeleteData(LocObject); if (ReturnValue != "true") { string AdditionalMsg = "This location is in use by a <DeviceType>. The <DeviceType> must be deleted or have its location changed first."; string deviceType = ""; if (ReturnValue.Contains("fk_MailServices_LocationID")) { deviceType = "mail service"; } else if (ReturnValue.Contains("FK_Servers_Location")) { deviceType = "server"; } if (deviceType == "") { (Session["ErrorStatus"]) = "This Location is used elsewhere for different servers. Cannot delete."; } else { Session["ErrorStatus"] = AdditionalMsg.Replace("<DeviceType>", deviceType); } DevExpress.Web.ASPxWebControl.RedirectOnCallback("~/Security/AdminTab.aspx"); } ASPxGridView gridView = (ASPxGridView)sender; gridView.CancelEdit(); e.Cancel = true; FillLocationsGrid(); }
protected void grid_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ASPxGridView grid = sender as ASPxGridView; DataTable table = new DataTable(); /* if (Convert.ToInt32(Request.QueryString["id"].ToString()) > 0) * { * table = new PayGrade().getByProductID(Convert.ToInt32(Request.QueryString["id"].ToString())); * DataColumn colid = table.Columns[0]; * table.PrimaryKey = new DataColumn[] { colid }; * } * else * {*/ table = GetTable(); // } DataRow dr = table.NewRow(); //if (e.NewValues["SallarySheetItemID"] != null) dr["SallarySheetItemID"] = e.NewValues["SallarySheetItemID"]; /*else * dr["SallarySheetItemID"] = "0"; */ dr["Name"] = e.NewValues["Name"]; dr["Nature"] = e.NewValues["Nature"]; dr["Type"] = e.NewValues["Type"]; dr["Order"] = e.NewValues["Order"]; table.Rows.Add(dr); // sumAmount +=Convert.ToDouble(e.NewValues["Amount"].ToString()); Session["Table"] = table; e.Cancel = true; grid.DataSource = table; grid.DataBind(); grid.CancelEdit(); }
protected void GridListagem_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ASPxGridView gridView = (ASPxGridView)sender; // string ID = ""; string codigo = ""; string descricao = ""; string conta_contabil = ""; // // codigo = e.NewValues["codigo"].ToString(); descricao = e.NewValues["descricao"].ToString(); if (e.NewValues["conta_contabil"] != null) { conta_contabil = e.NewValues["conta_contabil"].ToString(); } uReceitas.Grava(codigo, descricao, conta_contabil); gridView.CancelEdit(); e.Cancel = true; //Usando Classe uLog.MakeLog - Gravando Log fwObs_Log = "INCLUI CLASSE RECEITAS: " + codigo + "/" + descricao; SqlParameter[] param_log = { new SqlParameter("@login", (String)Session["CodUsuario"]), new SqlParameter("@tabela", fWtabela), new SqlParameter("@operacao", "CLASSE RECEITAS"), new SqlParameter("@obs", "INCLUI"), new SqlParameter("@acao", fwObs_Log) }; uLog.MakeLog(param_log); // AtualizaGrid(); }
protected void grdSCMProcurementOffDetails_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ASPxGridView grid = sender as ASPxGridView; ASPxHiddenField masterKey = grdSCMProcurementOffDetails.FindEditRowCellTemplateControl((GridViewDataColumn)grdSCMProcurementOffDetails.Columns["MasterKey"], "ASPxMasterKeyHiddenField") as ASPxHiddenField; ASPxComboBox scmProfCat = grid.FindEditRowCellTemplateControl((GridViewDataColumn)grid.Columns["ProcCatDesc"], "ProcurementCat") as ASPxComboBox; SqlConnection conn = new SqlConnection(GlobalClass.SQLConnString()); conn.Open(); string sLastModified = DateTime.Now.ToString(); string PK = e.Keys[0].ToString(); string update = "UPDATE tbl_System_SCMProcurementOfficer_Details " + " SET [ProcCat] = @ProcCat " + " WHERE ([PK] = @PK)"; SqlCommand cmd = new SqlCommand(update, conn); cmd.Parameters.AddWithValue("@PK", PK); cmd.Parameters.AddWithValue("@ProcCat", scmProfCat.Value.ToString()); cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); string updateMaster = "UPDATE tbl_System_SCMProcurementOfficer " + " SET [LastModified] = @LastModified " + " WHERE ([PK] = @PK)"; SqlCommand cmd1 = new SqlCommand(updateMaster, conn); cmd1.Parameters.AddWithValue("@PK", iProcOffMaster.ToString()); cmd1.Parameters.AddWithValue("@LastModified", sLastModified.ToString()); cmd1.CommandType = CommandType.Text; cmd1.ExecuteNonQuery(); conn.Close(); e.Cancel = true; grid.CancelEdit(); BindSCMProcOff_Details(iProcOffMaster); }
protected void gridResponse_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { String MilestoneID = Session["MilestoneID"].ToString(); String ItemID = Session["CriteriaId"].ToString(); ASPxGridView gridResponse = (ASPxGridView)sender; //ASPxComboBox AssessmentValue = (ASPxComboBox)gridResponse.FindEditFormLayoutItemTemplateControl("dropAssessment"); ASPxHtmlEditor txResponse = (ASPxHtmlEditor)gridResponse.FindEditFormLayoutItemTemplateControl("txResponse"); AssessmentResponse NewResponse = new AssessmentResponse { MilestoneID = Guid.Parse(Session["MilestoneID"].ToString()), ItemKey = Guid.Parse(ItemID), Assesment = e.NewValues["Assesment"].ToString(), Response = txResponse.Html }; rc_services.InsertNewResponse(NewResponse); e.Cancel = true; gridResponse.DataSource = rc_services.GetResponse(Guid.Parse(ItemID), MilestoneID); gridResponse.DataBind(); gridResponse.CancelEdit(); }
protected void GridListagem_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { ASPxGridView gridView = (ASPxGridView)sender; uPermissoes.ExcluiCadPermissao(e.Values["Permissao"].ToString()); // gridView.CancelEdit(); e.Cancel = true; //Usando Classe uLog.MakeLog - Gravando Log fwObs_Log = "PERMISSÃO: " + e.Values[0].ToString(); SqlParameter[] param_log = { new SqlParameter("@login", (String)Session["CodUsuario"]), new SqlParameter("@tabela", fWtabela), new SqlParameter("@operacao", "EXCLUSÃO"), new SqlParameter("@obs", "EXCLUSÃO PERMISSÃO"), new SqlParameter("@acao", fwObs_Log) }; uLog.MakeLog(param_log); // AtualizaGrid(); }
protected void Grid_ExchangeRate_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { try { //e.Cancel = true; session.BeginTransaction(); ASPxGridView grid = sender as ASPxGridView; //ExchangeRate exchangeid = session.GetObjectByKey<ExchangeRate>(Guid.Parse(e.Keys[0].ToString())); //exchangeid.RowStatus = Utility.Constant.ROWSTATUS_DELETED; //exchangeid.Save(); session.CommitTransaction(); grid.CancelEdit(); grid.DataBind(); } catch (Exception) { session.RollbackTransaction(); throw; } }
protected void ExchangeMailProbeGridView_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { try { ExchangeMailProbeClass MailProbObject = new ExchangeMailProbeClass(); MailProbObject.Name = e.Keys[0].ToString(); //Delete row from DB Object ReturnValue = VSWebBL.ConfiguratorBL.ExchangeMailProbeBL.Ins.DeleteData(MailProbObject); //Update Grid after inserting new row, refresh grid as in page load ASPxGridView gridView = (ASPxGridView)sender; gridView.CancelEdit(); e.Cancel = true; FillExchangeMailProbeGrid(); } catch (Exception ex) { //6/27/2014 NS added for VSPLUS-634 Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); throw ex; } }
protected void grillaEntregas_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { try { ASPxGridView grillaEntregas = sender as ASPxGridView; int codigoTaller = Convert.ToInt32(e.NewValues["codigoTaller"]); DateTime fechaInicio = Convert.ToDateTime(e.NewValues["fechaInicio"]); DateTime? fechaFin = Convert.ToDateTime(e.NewValues["fechaFin"]); if (fechaFin == Convert.ToDateTime("01/01/0001 00:00:00")) { fechaFin = null; } ControladorGeneral.InsertarActualizarEntrega(0, Convert.ToInt32(grillaEntregas.GetMasterRowKeyValue()), codigoTaller, fechaInicio, fechaFin); e.Cancel = true; grillaEntregas.CancelEdit(); CargarGrillaEntregas(grillaEntregas, Convert.ToInt32(grillaEntregas.GetMasterRowKeyValue())); } catch (Exception ex) { throw ex; } }
protected void ASPxGridView_Main_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ASPxGridView gridView = (ASPxGridView)sender; dt = (DataTable)Session["DataTable_CB"]; DataRow row = dt.NewRow(); e.NewValues["ID"] = GetNewId(); IDictionaryEnumerator enumerator = e.NewValues.GetEnumerator(); enumerator.Reset(); while (enumerator.MoveNext()) { if (enumerator.Key.ToString() != "Count") { row[enumerator.Key.ToString()] = enumerator.Value; } } gridView.CancelEdit(); e.Cancel = true; dt.Rows.Add(row); }
protected void RolesGridView_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { ASPxGridView grid = sender as ASPxGridView; var context = new ApplicationDbContext(); var manager = new RoleManager <IdentityRole>(new RoleStore <IdentityRole>(context)); var role = manager.FindById(e.Keys["Id"].ToString()); grid.CancelEdit(); e.Cancel = true; if (role != null) { IdentityResult result = manager.Delete(role); if (!result.Succeeded) { throw new Exception(result.Errors.FirstOrDefault()); } context.SaveChanges(); } grid.DataBind(); }
protected void gridMatrix_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ASPxGridView gridMatrix = (ASPxGridView)sender; ASPxGridView gridAssessItems = (ASPxGridView)gridMatrix.FindEditFormLayoutItemTemplateControl("gridAssessItems"); //ASPxGridLookup dropMatrix = (ASPxGridLookup)gridScorecards.FindEditFormLayoutItemTemplateControl("dropMatrix"); List <UniversalAssessmentItem> ItemsList = new List <UniversalAssessmentItem>(); for (int i = 0; i <= gridAssessItems.VisibleRowCount; i = i + 1) { if (gridAssessItems.Selection.IsRowSelected(i) == true) { ItemsList.Add(new UniversalAssessmentItem { Id = gridAssessItems.GetRowValues(i, "id").ToString() }); } } common_services.SaveXref(Session["xref_referenceid"].ToString(), ItemsList); e.Cancel = true; gridMatrix.CancelEdit(); gridMatrix.DataBind(); }
protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ds = (DataSet)Session["DataSet"]; ASPxGridView gridView = (ASPxGridView)sender; DataTable dataTable = gridView.GetMasterRowKeyValue() != null ? ds.Tables[1] : ds.Tables[0]; DataRow row = dataTable.NewRow(); e.NewValues["ID"] = GetNewId(); IDictionaryEnumerator enumerator = e.NewValues.GetEnumerator(); enumerator.Reset(); while (enumerator.MoveNext()) { if (enumerator.Key.ToString() != "Count") { row[enumerator.Key.ToString()] = enumerator.Value; } } gridView.CancelEdit(); e.Cancel = true; dataTable.Rows.Add(row); }
protected void dxgrid_OnRowInserting(object sender, ASPxDataInsertingEventArgs e) { ASPxGridView gv = (ASPxGridView)sender; string shortname = String.Format("{0}{1}" , e.NewValues["firstname"].ToString().Substring(0, 1) , e.NewValues["lastname"].ToString()); string staffinits = String.Format("{0}{1}" , e.NewValues["firstname"].ToString().Substring(0, 1) , e.NewValues["lastname"].ToString().Substring(0, 1)); e.NewValues.Add("active", "1"); e.NewValues.Add("staffshortname", shortname); e.NewValues.Add("staffinits", staffinits); bool result = DxDbOps.BuildInsertSqlCode(e, "tblStaff", "backend"); gv.CancelEdit(); e.Cancel = true; }
protected void grdSupplierOnMaterial_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ASPxGridView grdSupplierOnMaterial = sender as ASPxGridView; ASPxComboBox cboCode = grdSupplierOnMaterial.FindEditRowCellTemplateControl(grdSupplierOnMaterial.Columns["Code"] as GridViewDataColumn , "cboCodeSupplier") as ASPxComboBox; //List<MaterialSupplierEntity> table = SupplierEntityList; //if (table == null) // table = new List<MaterialSupplierEntity>(); //string selectedCode = cboCode.SelectedItem.Value.ToString(); //MaterialSupplierEntity supplier = new MaterialSupplierEntity(); //if (Mode != "add") //{ // supplier = materialBLO.getSupplierOnMaterial(selectedCode, KeyValue); //} //else //{ // supplier = materialBLO.getSupplierOnMaterial(selectedCode); //} //table.Add(new MaterialSupplierEntity( // supplier.MaterialSupplierId, // supplier.MaterialId, // supplier.SupplierId, // selectedCode, // supplier.Name //)); //materialBLO.addMaterialToSupplier(supplier, KeyValue); //SupplierEntityList = table; //grdSupplierOnMaterial.DataSource = table; grdSupplierOnMaterial.DataBind(); e.Cancel = true; grdSupplierOnMaterial.CancelEdit(); }
protected void AliasGridView_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { Credentials LocObject = new Credentials(); LocObject.ID = Convert.ToInt32(e.Keys[0]); //Delete row from DB string ReturnValue = VSWebBL.ConfiguratorBL.CredentialsBL.Ins.DeleteData(LocObject); if (ReturnValue != "true") { if (ReturnValue.Contains("FK_DominoServers_Credentials")) { (Session["ErrorStatus"]) = "This Credentials are used elsewhere. Cannot delete."; } if (ReturnValue.Contains("FK_O365Server_Credentials")) { (Session["ErrorStatus"]) = "This Credentials are used elsewhere. Cannot delete."; } if (ReturnValue.Contains("FK_WebsphereCell_Credentials")) { (Session["ErrorStatus"]) = "This Credentials are used elsewhere. Cannot delete."; } if (ReturnValue.Contains("FK_SametimeServers_Credentials")) { (Session["ErrorStatus"]) = "This Credentials are used elsewhere. Cannot delete."; } DevExpress.Web.ASPxWebControl.RedirectOnCallback("~/Configurator/PwrshellCredentials.aspx"); } //Update Grid after inserting new row, refresh grid as in page load ASPxGridView gridView = (ASPxGridView)sender; gridView.CancelEdit(); e.Cancel = true; FillAliasGrid(); }
protected void gridWorkflow_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { String ItemKey = Session["ItemKey"].ToString(); ASPxGridView gridWorkflow = (ASPxGridView)sender; ASPxComboBox dropStatus = (ASPxComboBox)gridWorkflow.FindEditFormLayoutItemTemplateControl("workflowDropStatus"); ASPxComboBox dropUser = (ASPxComboBox)gridWorkflow.FindEditFormLayoutItemTemplateControl("workflowdropUser"); ASPxHtmlEditor txComments = (ASPxHtmlEditor)gridWorkflow.FindEditFormLayoutItemTemplateControl("txComments"); Workflow NewStatus = new Workflow { ItemKey = Guid.Parse(ItemKey), ProjectID = Guid.Parse(Session["projectID"].ToString()), Status = dropStatus.Text, StatusValue = Convert.ToInt32(dropStatus.Value.ToString()), Comments = txComments.Html, WorkerID = (dropUser.Value == null) ? Guid.Empty : Guid.Parse(dropUser.Value.ToString()), ManagerID = Guid.Parse(rc_services.GetUserID()), DueDate = Convert.ToDateTime(e.NewValues[0]), StatusDate = DateTime.Now }; var item = rc_services.GetItemName(ItemKey); string worker = dropUser.Text.ToString(); Guid WorkerID = (dropUser.Value == null) ? Guid.Empty : Guid.Parse(dropUser.Value.ToString()); string manager = HttpContext.Current.Session["UserEmail"].ToString(); string projectName = HttpContext.Current.Session["ProjectName"].ToString(); string Status = dropStatus.Text; List <string> ListItems = new List <string>(); rc_services.WorkFlowNotificationEmail(WorkerID, worker, manager, projectName, Status, ListItems, item); rc_services.NewWorkflowStatus(NewStatus); e.Cancel = true; Guid projectID = Guid.Parse(Session["projectID"].ToString()); gridWorkflow.DataSource = rc_services.GetWorkflow(Guid.Parse(ItemKey), projectID); gridWorkflow.DataBind(); gridWorkflow.CancelEdit(); }
protected void POAddEditGrid_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ASPxTextBox qty = POAddEditGrid.FindEditRowCellTemplateControl((GridViewDataColumn)POAddEditGrid.Columns["POQty"], "POQty") as ASPxTextBox; ASPxTextBox cost = POAddEditGrid.FindEditRowCellTemplateControl((GridViewDataColumn)POAddEditGrid.Columns["POCost"], "POCost") as ASPxTextBox; ASPxTextBox total = POAddEditGrid.FindEditRowCellTemplateControl((GridViewDataColumn)POAddEditGrid.Columns["POTotalCost"], "POTotalCost") as ASPxTextBox; //ASPxGridView grid = sender as ASPxGridView; //MRPClass.PrintString(e.NewValues["POQty"].ToString()); //e.Cancel = true; //grid.CancelEdit(); DataSet ds = (DataSet)Session["DataSet"]; ASPxGridView gridView = (ASPxGridView)sender; DataTable dataTable = ds.Tables[0]; dataTable.PrimaryKey = new DataColumn[] { dataTable.Columns["PK"] }; DataRow row = dataTable.Rows.Find(e.Keys["PK"]); row["POQty"] = qty.Value.ToString(); row["POCost"] = cost.Value.ToString(); row["POTotalCost"] = total.Value.ToString(); IDictionaryEnumerator enumerator = e.NewValues.GetEnumerator(); enumerator.Reset(); while (enumerator.MoveNext()) { //MRPClass.PrintString(enumerator.Key.ToString()); row[enumerator.Key.ToString()] = enumerator.Value.ToString(); } gridView.CancelEdit(); e.Cancel = true; POAddEditGrid.DataSource = dataTable; POAddEditGrid.KeyFieldName = "PK"; POAddEditGrid.DataBind(); }
protected void POGrid_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ASPxGridView grid = sender as ASPxGridView; ASPxPageControl pageControl = grid.FindEditFormTemplateControl("GridPageControl") as ASPxPageControl; ASPxComboBox entity = pageControl.FindControl("EntityCode") as ASPxComboBox; ASPxTextBox entityname = pageControl.FindControl("EntityName") as ASPxTextBox; ASPxTextBox header = pageControl.FindControl("HeaderPath") as ASPxTextBox; ASPxTextBox line = pageControl.FindControl("LinePath") as ASPxTextBox; ASPxTextBox domain = pageControl.FindControl("Domain") as ASPxTextBox; ASPxTextBox uname = pageControl.FindControl("Uname") as ASPxTextBox; ASPxTextBox Pword = pageControl.FindControl("Pword") as ASPxTextBox; SqlConnection conn = new SqlConnection(GlobalClass.SQLConnString()); conn.Open(); string encrypted_password = EncryptionClass.Encrypt(Pword.Text); string insert = "INSERT INTO [dbo].[tbl_AXPOUploadingPath] ([Entity], [Entity Name], [POHeaderPath], [POLinePath], [Domain], [UserName], [Password]) VALUES (@Entity, @EntityName, @POHeaderPath, @POLinePath, @Domain, @UserName, @Password)"; SqlCommand cmd = new SqlCommand(insert, conn); cmd.Parameters.AddWithValue("@Entity", entity.Text); cmd.Parameters.AddWithValue("@EntityName", entityname.Text); cmd.Parameters.AddWithValue("@POHeaderPath", header.Text); cmd.Parameters.AddWithValue("@POLinePath", line.Text); cmd.Parameters.AddWithValue("@Domain", domain.Text); cmd.Parameters.AddWithValue("@UserName", uname.Text); cmd.Parameters.AddWithValue("@Password", encrypted_password); cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); conn.Close(); grid.CancelEdit(); e.Cancel = true; BindGrid(); }
protected void grdFinanceBudgetDet_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) { ASPxGridView grid = sender as ASPxGridView; if (e.Parameters == "AddNew") { //MRPClass.PrintString("pass add"); if (grdFinanceBudget.VisibleRowCount == 0) { return; } bool parseInt = int.TryParse(grdFinanceBudget.GetRowValues(grdFinanceBudget.FocusedRowIndex, "PK").ToString(), out iMasterKey); if (parseInt == false) { return; } if (iMasterKey == 0) { return; } bindBudgetDetList = false; sBudgetDetEnt = ""; sBudgetDetBU = ""; grdFinanceBudgetDet.AddNewRow(); } if (e.Parameters == "BudOff") { iMasterKey = 0; if (grdFinanceBudget.VisibleRowCount > 0) { iMasterKey = Convert.ToInt32(grdFinanceBudget.GetRowValues(grdFinanceBudget.FocusedRowIndex, "PK").ToString()); } grid.CancelEdit(); BindFinanceBudgetDet(iMasterKey); } }
protected void UsersGridView_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { ASPxGridView grid = sender as ASPxGridView; var manager = Context.GetOwinContext().GetUserManager <ApplicationUserManager>(); var user = manager.FindById(e.Keys["Id"].ToString()); grid.CancelEdit(); e.Cancel = true; if (user != null) { IdentityResult result = manager.Delete(user); if (!result.Succeeded) { throw new Exception(result.Errors.FirstOrDefault()); } } grid.DataBind(); //var context = new ApplicationDbContext(); //var userManager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(context)); //var user = userManager.FindById(e.Keys["Id"].ToString()); //if (user != null) //{ // var result = userManager.Delete(user); // if (result.Succeeded) // { // var row = UsersTable.Rows.Find(e.Keys["Id"].ToString()); // if (row != null) // { // UsersTable.Rows.Remove(row); // UsersTable.AcceptChanges(); // context.SaveChanges(); // } // } //} //grid.DataSource = UsersTable; //grid.DataBind(); }
protected override void EndEditing(ASPxGridView gridView, System.ComponentModel.CancelEventArgs e) { e.Cancel = true; gridView.CancelEdit(); gridView.DataBind(gridView.DataSource as XPCollection); }
protected void CancelEditingFromEditing(ASPxGridView gridView, CancelEventArgs e) { e.Cancel = true; gridView.CancelEdit(); gridView.DataBind(gridView.DataSource as XPCollection); }