private void btnAlt_Click(object sender, RoutedEventArgs e) { ObservableCollection <T_OA_COSTRECORD> selectItems = GetSelectList(); if (selectItems != null) { T_OA_COSTRECORD costRecord = selectItems[0]; if (costRecord.FORMID != null) { MessageBox.Show("不能修改"); return; } CFrmCostRecordManager vehicleInfo = new CFrmCostRecordManager(); vehicleInfo.EditState = "update"; vehicleInfo.CostInfo = costRecord; EntityBrowser browser = new EntityBrowser(vehicleInfo); browser.MinWidth = 500; browser.MinHeight = 400; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }, true); } else { Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARNING"), Utility.GetResourceStr("SELECTWARNING", "UPDATE")); } }
private void SetFormDefailValue(T_OA_COSTRECORD defaultInfo) { txtContent.Text = defaultInfo.CONTENT; dpCostDate.Text = defaultInfo.COSTDATE.ToShortDateString(); Utility.SetComboboxSelectByText(cmbCostType, defaultInfo.CONSTTYPE, -1); txtCost.Text = defaultInfo.COST.ToString(); cmbVehicleAssetId.IsEnabled = false; }
private int DeleteCostRecord(T_OA_COSTRECORD cvInfo) { CostRecordManagementBll crmBll = new CostRecordManagementBll(); if (crmBll.DeleteInfo(cvInfo) == true) { return 1; } return -1; }
private int UpdateCostRecord(T_OA_COSTRECORD cvInfo) { CostRecordManagementBll crmBll = new CostRecordManagementBll(); if (crmBll.UpdateInfo(cvInfo) == -1) { return -1; } return 1; }
private int DeleteCostRecord(T_OA_COSTRECORD cvInfo) { CostRecordManagementBll crmBll = new CostRecordManagementBll(); if (crmBll.DeleteInfo(cvInfo) == true) { return(1); } return(-1); }
private void AddInfo() { //if (DataValidation() == false) //{ // return; //} if (!Check()) { return; } T_OA_COSTRECORD newInfo = new T_OA_COSTRECORD(); newInfo.T_OA_VEHICLE = (T_OA_VEHICLE)cmbVehicleAssetId.SelectedItem; newInfo.CONSTTYPE = ((SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY)cmbCostType.SelectedItem).DICTIONARYNAME.ToString(); newInfo.CONTENT = txtContent.Text; newInfo.COST = Convert.ToDecimal(txtCost.Text); newInfo.COSTDATE = Convert.ToDateTime(dpCostDate.Text); newInfo.COSTRECORDID = System.Guid.NewGuid().ToString(); newInfo.CREATECOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; newInfo.CREATEDATE = System.DateTime.Now; newInfo.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; newInfo.CREATEPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID; newInfo.CREATEUSERID = Common.CurrentLoginUserInfo.EmployeeID; newInfo.CREATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName; newInfo.OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; newInfo.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; newInfo.OWNERPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID; newInfo.OWNERID = Common.CurrentLoginUserInfo.EmployeeID; newInfo.OWNERNAME = Common.CurrentLoginUserInfo.EmployeeName; newInfo.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; newInfo.OWNERPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID; newInfo.OWNERNAME = Common.CurrentLoginUserInfo.EmployeeName; newInfo.OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; newInfo.UPDATEDATE = System.DateTime.Now; newInfo.UPDATEUSERID = Common.CurrentLoginUserInfo.EmployeeID; RefreshUI(RefreshedTypes.ShowProgressBar); vehicleManager.AddCostRecordAsync(newInfo); }
private void UpdateInfo(T_OA_COSTRECORD updateInfo) { if (!Check()) { return; } updateInfo.T_OA_VEHICLE = (T_OA_VEHICLE)cmbVehicleAssetId.SelectedItem; updateInfo.CONSTTYPE = ((SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY)cmbCostType.SelectedItem).DICTIONARYNAME.ToString(); updateInfo.CONTENT = txtContent.Text; updateInfo.COST = Convert.ToDecimal(txtCost.Text); updateInfo.COSTDATE = Convert.ToDateTime(dpCostDate.Text); //updateInfo.OWNERCOMPANYID = ""; //updateInfo.OWNERDEPARTMENTID = ""; //updateInfo.OWNERID = txtOwnerID.Text; //updateInfo.OWNERNAME = ""; //updateInfo.OWNERPOSTID = ""; updateInfo.UPDATEDATE = System.DateTime.Now; updateInfo.UPDATEUSERID = Common.CurrentLoginUserInfo.EmployeeID; RefreshUI(RefreshedTypes.ProgressBar); vehicleManager.UpdateCostRecordAsync(updateInfo); }