示例#1
0
        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"));
            }
        }
示例#2
0
 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;
 }
示例#3
0
 private int DeleteCostRecord(T_OA_COSTRECORD cvInfo)
 {
     CostRecordManagementBll crmBll = new CostRecordManagementBll();
     if (crmBll.DeleteInfo(cvInfo) == true)
     {
         return 1;
     }
     return -1;
 }
示例#4
0
 private int UpdateCostRecord(T_OA_COSTRECORD cvInfo)
 {
     CostRecordManagementBll crmBll = new CostRecordManagementBll();
     if (crmBll.UpdateInfo(cvInfo) == -1)
     {
         return -1;
     }
     return 1;
 }
示例#5
0
        private int DeleteCostRecord(T_OA_COSTRECORD cvInfo)
        {
            CostRecordManagementBll crmBll = new CostRecordManagementBll();

            if (crmBll.DeleteInfo(cvInfo) == true)
            {
                return(1);
            }
            return(-1);
        }
示例#6
0
        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);
        }
示例#7
0
        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);
        }
示例#8
0
        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);
        }
示例#9
0
        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);
        }
示例#10
0
 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;
 }