protected void ArtifactsGrid_HtmlEditFormCreated(object sender, ASPxGridViewEditFormEventArgs e) { ASPxGridView gridView = (ASPxGridView)sender; ASPxUploadControl uploader = (ASPxUploadControl)gridView.FindEditFormLayoutItemTemplateControl("ArtifactUploader"); uploader.AzureSettings.ContainerName = Session["enterpriseID"].ToString().ToLower(); }
protected void gridArtifacts_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ASPxGridView gridArtifacts = (ASPxGridView)sender; ASPxGridView gridRepository = (ASPxGridView)gridArtifacts.FindEditFormLayoutItemTemplateControl("gridRepository"); //Use class AttachmentList to create a list of artifacts to be attached AttachmentList xMultiAttachment = new AttachmentList(); //go through grid and create an unit for each selected item for (int i = 0; i <= gridRepository.VisibleRowCount; i = i + 1) { if (gridRepository.Selection.IsRowSelected(i) == true) { //get page ref from text box inside cell template ASPxTextBox txPage = (ASPxTextBox)gridRepository.FindRowCellTemplateControl(i, gridRepository.DataColumns[8], "txPage"); xMultiAttachment.Add(new Attachment() { ArtifactID = gridRepository.GetRowValues(i, "ArtifactID").ToString(), ProjectID = gridRepository.GetRowValues(i, "ProjectID").ToString(), PageReference = txPage.Text.ToString(), ItemID = Session["ItemKey"].ToString() }); } } //If any selected, call the function in rc_services to attach multiple artifacts if (xMultiAttachment.Count > 0) { string xMultiAttachResult = rc_services.AttachArtifact(xMultiAttachment); e.Cancel = true; gridArtifacts.CancelEdit(); gridArtifacts.DataBind(); gridRepository.Selection.UnselectAll(); } }
protected void gridMultiAssign_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ASPxGridView gridMultiAssign = (ASPxGridView)sender; ASPxGridView gridAssessItems = (ASPxGridView)gridMultiAssign.FindEditFormLayoutItemTemplateControl("gridAssessItems"); List <MultiAssignWorkflow> ItemsList = new List <MultiAssignWorkflow>(); for (int i = 0; i <= gridAssessItems.VisibleRowCount; i = i + 1) { if (gridAssessItems.Selection.IsRowSelected(i) == true) { ItemsList.Add(new MultiAssignWorkflow { ID = gridAssessItems.GetRowValues(i, "ID").ToString() }); } } var projectId = ddlProjects.Value.ToString(); Workflow NewStatus = new Workflow { ProjectID = Guid.Parse(projectId), Status = dropStatus.Text, StatusValue = Convert.ToInt32(dropStatus.Value.ToString()), Comments = "", WorkerID = (cmbUser.Value == null) ? Guid.Empty : Guid.Parse(cmbUser.Value.ToString()), ManagerID = Guid.Parse(rc_services.GetUserID()), DueDate = Convert.ToDateTime(dateEdit.Value), StatusDate = DateTime.Now }; rc_services.NewMultiWorkflowStatus(ItemsList, NewStatus); List <string> ListItems = new List <string>(); for (int i = 0; i <= gridAssessItems.VisibleRowCount; i = i + 1) { if (gridAssessItems.Selection.IsRowSelected(i) == true) { ListItems.Add(gridAssessItems.GetRowValues(i, "Identifier").ToString()); } } string worker = cmbUser.Text.ToString(); Guid WorkerID = (cmbUser.Value == null) ? Guid.Empty : Guid.Parse(cmbUser.Value.ToString()); string manager = HttpContext.Current.Session["UserEmail"].ToString(); string projectName = HttpContext.Current.Session["ProjectName"].ToString(); string Status = dropStatus.Text; var item = ""; rc_services.WorkFlowNotificationEmail(WorkerID, worker, manager, projectName, Status, ListItems, item); e.Cancel = true; gridMultiAssign.CancelEdit(); string userId = cmbUser.Value.ToString(); string Area = cmbArea.Value.ToString(); gridMultiAssign.DataSource = rc_services.GetMultiAssignWorkflowItems(userId, projectId, Area); gridMultiAssign.DataBind(); }
protected void gridResponse_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { // String MilestoneID = Session["MilestoneID"].ToString(); String ItemID = Session["ItemKey"].ToString(); ASPxGridView gridResponse = (ASPxGridView)sender; ASPxHtmlEditor txResponse = (ASPxHtmlEditor)gridResponse.FindEditFormLayoutItemTemplateControl("txResponse"); AssessmentResponse UpdateResponse = new AssessmentResponse { ResponseID = Guid.Parse(e.Keys["ResponseID"].ToString()), MilestoneName = e.NewValues["MilestoneName"].ToString(), ItemKey = Guid.Parse(ItemID), // MilestoneID = Guid.Parse(""), Response = txResponse.Html }; rc_services.SaveResponse(UpdateResponse); e.Cancel = true; gridResponse.DataSource = rc_services.GetResponse(Guid.Parse(ItemID)); gridResponse.DataBind(); gridResponse.CancelEdit(); BindMainGrids(); }
protected void gvENT_OnRowUpdating(object sender, ASPxDataUpdatingEventArgs e) { ASPxGridView gv = (ASPxGridView)sender; //Get and Process the list of selected records in order to populate the list of pkvals #region process selected records var selected_keys = gvENT.GetSelectedFieldValues("actionID"); ASPxCheckBox chkAllSelected = gv.FindEditFormLayoutItemTemplateControl("chkUpdateAllSelected") as ASPxCheckBox; bool updateALLSelected = chkAllSelected.Checked; List <int> pkvals = new List <int>(); foreach (object key in e.Keys.Values) { int ikey; bool isint = int.TryParse(key.ToString(), out ikey); if (isint) { pkvals.Add(ikey); } } //Add the other selected rows to the update if the user has selected the "Update All" checkbox if (selected_keys.Count > 0 && updateALLSelected) { foreach (object k in selected_keys) { int ikey; bool isint = int.TryParse(k.ToString(), out ikey); if (!pkvals.Contains(ikey)) { pkvals.Add(ikey); } } } #endregion //Custom: retrieve specific data from the grid //Get the data from the ComboBoxes ASPxComboBox cboAS = (ASPxComboBox)gvENT.FindEditFormLayoutItemTemplateControl("CboAS"); e.NewValues["actionstatusID"] = cboAS.Value; ASPxMemo notes = (ASPxMemo)gvENT.FindEditFormLayoutItemTemplateControl("notesEditor"); e.NewValues["Notes"] = notes.Value; string result = dataops.dxGrid_UpdateData("actionID", pkvals, e.NewValues, "backend", "dbo", "tblAction"); gvENTstatus.Text = result; gv.CancelEdit(); e.Cancel = true; gvENT.DataBind(); }
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(); }
public static void AddField(OrderedDictionary newvals, ASPxGridView gv, string fldname, string ctlname, DevExpress.Web.ControlType ctype) { //Check to see if there is a checkbox "DoNotUpdate" and do not process if checked ASPxCheckBox chk = (ASPxCheckBox)gv.FindEditFormLayoutItemTemplateControl(ctlname + "_DoNotUpdate"); bool processThisControl = true; if (chk != null) { if (chk.Checked == true) { processThisControl = false; } } if (processThisControl) { switch (ctype) { case DevExpress.Web.ControlType.ASPxComboBox: ASPxComboBox cbo = (ASPxComboBox)gv.FindEditFormLayoutItemTemplateControl(ctlname); newvals[fldname] = cbo.Value; break; case DevExpress.Web.ControlType.ASPxTextBox: ASPxTextBox txt = (ASPxTextBox)gv.FindEditFormLayoutItemTemplateControl(ctlname); newvals[fldname] = txt.Value; break; case DevExpress.Web.ControlType.ASPxMemo: ASPxMemo mem = (ASPxMemo)gv.FindEditFormLayoutItemTemplateControl(ctlname); newvals[fldname] = mem.Value; break; case DevExpress.Web.ControlType.ASPxCalendar: ASPxCalendar cal = (ASPxCalendar)gv.FindEditFormLayoutItemTemplateControl(ctlname); newvals[fldname] = cal.Value; break; case DevExpress.Web.ControlType.ASPxDateEdit: ASPxDateEdit dateedit = (ASPxDateEdit)gv.FindEditFormLayoutItemTemplateControl(ctlname); newvals[fldname] = dateedit.Value; break; } } else { //remove the field from the update as it is not to be updated newvals.Remove(fldname); } }
protected void gridAssociatedGapsGoals_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { if (Session["TaskID"] != null) { ASPxGridView gridAssociatedGapsGoals = (ASPxGridView)sender; ASPxGridView gridGapandGoals = (ASPxGridView)gridAssociatedGapsGoals.FindEditFormLayoutItemTemplateControl("gridGapandGoals"); List <string> ItemsList = new List <string>(); for (int i = 0; i <= gridGapandGoals.VisibleRowCount; i = i + 1) { if (gridGapandGoals.Selection.IsRowSelected(i) == true) { ItemsList.Add(gridGapandGoals.GetRowValues(i, "gap_id").ToString()); } } rc_services.InsertAssociatedGapsandGoals(Session["TaskID"].ToString(), ItemsList); e.Cancel = true; gridAssociatedGapsGoals.CancelEdit(); gridAssociatedGapsGoals.DataBind(); } }
protected void gridComponentRTMItem_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { if (Session["ComponentId"] != null) { ASPxGridView gridComponentRTMItem = (ASPxGridView)sender; ASPxGridView gridRTMItem = (ASPxGridView)gridComponentRTMItem.FindEditFormLayoutItemTemplateControl("gridRTMItem"); List <string> ItemsList = new List <string>(); for (int i = 0; i <= gridRTMItem.VisibleRowCount; i = i + 1) { if (gridRTMItem.Selection.IsRowSelected(i) == true) { ItemsList.Add(gridRTMItem.GetRowValues(i, "src_id").ToString()); } } rc_services.InsertComponentProjectRTMItem(Session["ComponentId"].ToString(), ItemsList); e.Cancel = true; gridComponentRTMItem.CancelEdit(); gridComponentRTMItem.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 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 gvM_OnRowUpdating(object sender, ASPxDataUpdatingEventArgs e) { ASPxGridView gv = (ASPxGridView)sender; //Get and Process the list of selected records in order to populate the list of pkvals #region process selected records var selected_keys = gvM.GetSelectedFieldValues("StudyMeasSubjID"); ASPxCheckBox chkAllSelected = gv.FindEditFormLayoutItemTemplateControl("chkUpdateAllSelected") as ASPxCheckBox; bool updateALLSelected = chkAllSelected.Checked; List <int> pkvals = new List <int>(); foreach (object key in e.Keys.Values) { int ikey; bool isint = int.TryParse(key.ToString(), out ikey); if (isint) { pkvals.Add(ikey); } } //Add the other selected rows to the update if the user has selected the "Update All" checkbox if (selected_keys.Count > 0 && updateALLSelected) { foreach (object k in selected_keys) { int ikey; bool isint = int.TryParse(k.ToString(), out ikey); if (!pkvals.Contains(ikey)) { pkvals.Add(ikey); } } } #endregion popupdata.AddField(e.NewValues, gvM, "MeasStatusID", "CboMS", DevExpress.Web.ControlType.ASPxComboBox); popupdata.AddField(e.NewValues, gvM, "MeasStatusDetailID", "CboMSD", DevExpress.Web.ControlType.ASPxComboBox); popupdata.AddField(e.NewValues, gvM, "Date", "DateCalendar", DevExpress.Web.ControlType.ASPxDateEdit); popupdata.AddField(e.NewValues, gvM, "Clinician", "CboClin", DevExpress.Web.ControlType.ASPxComboBox); popupdata.AddField(e.NewValues, gvM, "Notes", "notesEditor", DevExpress.Web.ControlType.ASPxMemo); ASPxRadioButtonList rblDate = gv.FindEditFormLayoutItemTemplateControl("rblDate") as ASPxRadioButtonList; if (rblDate.Value != null) { //remove the entered date as we will programmatically assign a different date e.NewValues.Remove("Date"); //Update the date based on the selected mode string mode = rblDate.Value.ToString(); string date_update = dataops.dxGrid_Update_StudyMeasSubj_Dates(mode, pkvals); } string result = dataops.dxGrid_UpdateData("studymeassubjID", pkvals, e.NewValues, "backend", "dbo", "tblStudyMeasSubj"); lblTest.Text = result; gv.CancelEdit(); e.Cancel = true; ViewState["needBind"] = "true"; gvM.DataBind(); }
protected void gvA_OnRowUpdating(object sender, ASPxDataUpdatingEventArgs e) { ASPxGridView gv = (ASPxGridView)sender; var selected_keys = gvA.GetSelectedFieldValues("ActionID"); ASPxCheckBox chkAllSelected = gv.FindEditFormLayoutItemTemplateControl("chkUpdateAllSelected") as ASPxCheckBox; bool updateALLSelected = chkAllSelected.Checked; List <int> pkvals = new List <int>(); foreach (object key in e.Keys.Values) { int ikey; bool isint = int.TryParse(key.ToString(), out ikey); if (isint) { pkvals.Add(ikey); } } //Add the other selected rows to the update if the user has selected the "Update All" checkbox if (selected_keys.Count > 0 && updateALLSelected) { foreach (object k in selected_keys) { int ikey; bool isint = int.TryParse(k.ToString(), out ikey); if (!pkvals.Contains(ikey)) { pkvals.Add(ikey); } } } ////Get the data from the ComboBoxes //ASPxComboBox cboMS = (ASPxComboBox)gvM.FindEditFormLayoutItemTemplateControl( "CboMS"); //ASPxComboBox cboMSD = (ASPxComboBox)gvM.FindEditFormLayoutItemTemplateControl( "CboMSD"); //e.NewValues["MeasStatusID"] = cboMS.Value; //e.NewValues["MeasStatusDetailID"] = cboMSD.Value; //ASPxMemo notes = (ASPxMemo)gvM.FindEditFormLayoutItemTemplateControl("notesEditor"); //e.NewValues["Notes"] = notes.Value; ////string result = dxGrid_UpdateData(e.Keys, e.NewValues, "backend", "dbo", "tblStudyMeasSubj"); //string result = dataops.dxGrid_UpdateData("studymeassubjID", pkvals, e.NewValues, "backend", "dbo", "tblStudyMeasSubj"); popupdata.AddField(e.NewValues, gvA, "ActionStatusID", "CboAS", DevExpress.Web.ControlType.ASPxComboBox); popupdata.AddField(e.NewValues, gvA, "DateDone", "DateCalendarA", DevExpress.Web.ControlType.ASPxDateEdit); //popupdata.AddField(e.NewValues, gvA, "Clinician", "CboClinA", DevExpress.Web.ControlType.ASPxComboBox); popupdata.AddField(e.NewValues, gvA, "Notes", "notesEditorA", DevExpress.Web.ControlType.ASPxMemo); string result = dataops.dxGrid_UpdateData("actionID", pkvals, e.NewValues, "backend", "dbo", "tblAction"); gvAstatus.Text = result; //gvM.JSProperties["gvM_IsUpdated"] = true; gv.CancelEdit(); e.Cancel = true; gvA.DataBind(); }