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