protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ASPxComboBox pline = ASPxGridView1.FindEditFormTemplateControl("combPline") as ASPxComboBox; ASPxComboBox workUnit = ASPxGridView1.FindEditFormTemplateControl("comWorkUnit") as ASPxComboBox; ASPxComboBox detectData = ASPxGridView1.FindEditFormTemplateControl("comDetectItem") as ASPxComboBox; DetectErrorItemEntity detEntity = new DetectErrorItemEntity(); detEntity.COMPANY_CODE = theCompanyCode; detEntity.DETECT_ITEM_CODE = detectData.Value.ToString(); detEntity.DETECT_ITEM_NAME = detectData.Text.ToString(); detEntity.ERROR_ITEM_CODE = e.NewValues["ERROR_ITEM_CODE"].ToString(); detEntity.ERROR_ITEM_NAME = e.NewValues["ERROR_ITEM_NAME"].ToString(); detEntity.PLINE_CODE = pline.SelectedItem.Value.ToString(); detEntity.WORKUNIT_CODE = e.NewValues["WORKUNIT_CODE"].ToString(); db.Insert(detEntity); e.Cancel = true; ASPxGridView1.CancelEdit(); setCondition(); }
protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { string rmes_id = e.OldValues["RMES_ID"].ToString(); DetectErrorItemEntity detEntity = db.First <DetectErrorItemEntity>("where rmes_id=@0", rmes_id); ASPxComboBox pline = ASPxGridView1.FindEditFormTemplateControl("combPline") as ASPxComboBox; ASPxComboBox workUnit = ASPxGridView1.FindEditFormTemplateControl("comWorkUnit") as ASPxComboBox; ASPxComboBox detectData = ASPxGridView1.FindEditFormTemplateControl("comDetectItem") as ASPxComboBox; detEntity.COMPANY_CODE = theCompanyCode; detEntity.PLINE_CODE = pline.SelectedItem.Value.ToString(); detEntity.WORKUNIT_CODE = e.NewValues["WORKUNIT_CODE"].ToString(); detEntity.DETECT_ITEM_CODE = detectData.Value.ToString(); detEntity.DETECT_ITEM_NAME = detectData.Text.ToString(); detEntity.ERROR_ITEM_CODE = e.NewValues["ERROR_ITEM_CODE"].ToString(); detEntity.ERROR_ITEM_NAME = e.NewValues["ERROR_ITEM_NAME"].ToString(); db.Update(detEntity); e.Cancel = true; ASPxGridView1.CancelEdit(); setCondition(); }
protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { string rmes_id = e.Values["RMES_ID"].ToString(); DetectErrorItemEntity detEntity = new DetectErrorItemEntity { RMES_ID = rmes_id }; //QualityStandardItem detEntity = db.First<QualityStandardItem>("where rmes_id=@0", rmes_id); db.Delete(detEntity); setCondition(); e.Cancel = true; }