void btnAudit_Click(object sender, RoutedEventArgs e)
        {
            if (dg.SelectedItems == null)
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "AUDIT"), Utility.GetResourceStr("CONFIRMBUTTON"));
                return;
            }

            if (dg.SelectedItems.Count == 0)
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "AUDIT"), Utility.GetResourceStr("CONFIRMBUTTON"));
                return;
            }

            T_OA_CONSERVATION ent = dg.SelectedItems[0] as T_OA_CONSERVATION;

            if (ent.CHECKSTATE == ((int)CheckStates.Approving).ToString() ||
                ent.CHECKSTATE == ((int)CheckStates.WaittingApproval).ToString() ||
                ent.CHECKSTATE == ((int)CheckStates.UnSubmit).ToString())
            {
                ConserVationForm_aud form    = new ConserVationForm_aud(FormTypes.Audit, ent.CONSERVATIONID);
                EntityBrowser        browser = new EntityBrowser(form);
                browser.FormType         = FormTypes.Audit;
                browser.MinWidth         = 750;
                browser.MinHeight        = 420;
                browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent);
                browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }, true);
            }
            else
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTRECORDNOTOPERATEPLEASEAGAIN"));
                return;
            }
        }
Beispiel #2
0
 void ConserVationForm_Loaded(object sender, RoutedEventArgs e)
 {
     _VM.AddConserVationCompleted    += new EventHandler <AddConserVationCompletedEventArgs>(AddConserVationCompleted);
     _VM.UpdateConserVationCompleted += new EventHandler <UpdateConserVationCompletedEventArgs>(UpdateConserVationCompleted);
     _VM.GetVehicleInfoListCompleted += new EventHandler <GetVehicleInfoListCompletedEventArgs>(_VM_GetVehicleInfoListCompleted);
     fbCtr.SaveCompleted             += new EventHandler <SMT.SaaS.FrameworkUI.FBControls.ChargeApplyControl.SaveCompletedArgs>(fbCtr_SaveCompleted);
     if (types == FormTypes.New)
     {
         conserVation                = new T_OA_CONSERVATION();
         conserVation.CHECKSTATE     = ((int)CheckStates.UnSubmit).ToString();
         conserVation.CONSERVATIONID = System.Guid.NewGuid().ToString();
     }
     //LayoutRoot_Loaded(sender,e);
     _VM.GetVehicleInfoListAsync(null);
     Utility.BindComboBox(cmbConserVationName, "CONSERVANAME", 0);
     dateREPAIRDATE.Text   = DateTime.Today.ToShortDateString();
     dateRETRIEVEDATE.Text = DateTime.Today.AddDays(2).ToShortDateString();
     txtTel.Text           = Utility.GetEmployeePhone();
     if (conserVation != null)
     {
         SetFormDefailValue(conserVation);
     }
     if (types != FormTypes.New)
     {
         RefreshUI(RefreshedTypes.AuditInfo);
         RefreshUI(RefreshedTypes.All);
     }
     SetForms();
     InitFBControl();
     LayoutRoot_Loaded(sender, e);
 }
        //编辑
        private void btnEdit_Click(object sender, RoutedEventArgs e)
        {
            ObservableCollection <T_OA_CONSERVATION> selectInfoList = GetSelectList();

            if (selectInfoList != null && selectInfoList.Count > 0)
            {
                selApporvalInfo = selectInfoList[0];
                if (selApporvalInfo.CHECKSTATE == ((int)CheckStates.UnSubmit).ToString() || selApporvalInfo.CHECKSTATE == ((int)CheckStates.UnApproved).ToString())
                {
                    ConserVationForm form = new ConserVationForm(FormTypes.Edit);
                    form.EditState    = "update";
                    form.ConserVation = selectInfoList[0];
                    EntityBrowser browser = new EntityBrowser(form);
                    browser.FormType         = FormTypes.Edit;
                    browser.MinWidth         = 750;
                    browser.MinHeight        = 420;
                    browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent);
                    browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }, true);
                }
                else
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTONLYCANMODIFYTHEDATASUBMITTED"));
                    return;
                }
            }
            else
            {
                Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTERROR", "UPDATE"));
            }
        }
        void Get_VConserVationCompleted(object sender, Get_VConserVationCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                conserVation = e.Result;

                if (conserVation != null)
                {
                    Utility.SetComboboxSelectByText(cmbConserVationName, conserVation.CONSERVATYPE, -1);
                    txtContent.Text     = conserVation.CONTENT;
                    txtFee.Text         = conserVation.CHARGEMONEY.ToString();
                    ckbHasFee.IsChecked = conserVation.ISCHARGE == "1" ? true : false;

                    txtContent.IsEnabled          = true;
                    txtFee.IsEnabled              = true;
                    cmbConserVationName.IsEnabled = false;

                    RefreshUI(RefreshedTypes.AuditInfo);
                    RefreshUI(RefreshedTypes.All);
                    //InitAudit(conserVation.CONSERVATIONID);
                    InitFBControl();
                    //viewApproval.XmlObject = DataObjectToXml<T_OA_CONSERVATION>.ObjListToXml(conserVation, "OA");
                }
            }
        }
Beispiel #5
0
 void ConserVationForm_Loaded(object sender, RoutedEventArgs e)
 {
     _VM.AddConserVationCompleted += new EventHandler<AddConserVationCompletedEventArgs>(AddConserVationCompleted);
     _VM.UpdateConserVationCompleted += new EventHandler<UpdateConserVationCompletedEventArgs>(UpdateConserVationCompleted);
     _VM.GetVehicleInfoListCompleted += new EventHandler<GetVehicleInfoListCompletedEventArgs>(_VM_GetVehicleInfoListCompleted);
     fbCtr.SaveCompleted += new EventHandler<SMT.SaaS.FrameworkUI.FBControls.ChargeApplyControl.SaveCompletedArgs>(fbCtr_SaveCompleted);
     if (types == FormTypes.New)
     {
         conserVation = new T_OA_CONSERVATION();
         conserVation.CHECKSTATE = ((int)CheckStates.UnSubmit).ToString();
         conserVation.CONSERVATIONID = System.Guid.NewGuid().ToString();
     }
     //LayoutRoot_Loaded(sender,e);
     _VM.GetVehicleInfoListAsync(null);
     Utility.BindComboBox(cmbConserVationName, "CONSERVANAME", 0);
     dateREPAIRDATE.Text = DateTime.Today.ToShortDateString();
     dateRETRIEVEDATE.Text = DateTime.Today.AddDays(2).ToShortDateString();
     txtTel.Text = Utility.GetEmployeePhone();
     if (conserVation != null)
         SetFormDefailValue(conserVation);
     if (types != FormTypes.New)
     {
         RefreshUI(RefreshedTypes.AuditInfo);
         RefreshUI(RefreshedTypes.All);
     }
     SetForms();
     InitFBControl();
     LayoutRoot_Loaded(sender,e);
 }
Beispiel #6
0
 private int AddConserVation(T_OA_CONSERVATION cvInfo)
 {
     ConserVationManagementBll cvmBll = new ConserVationManagementBll();
     if (cvmBll.AddInfo(cvInfo) == true)
     {
         return 1;
     }
     return -1;
 }
Beispiel #7
0
        private int DeleteConserVation(T_OA_CONSERVATION cvInfo)
        {
            ConserVationManagementBll cvmBll = new ConserVationManagementBll();

            if (cvmBll.DeleteInfo(cvInfo) == true)
            {
                return(1);
            }
            return(-1);
        }
Beispiel #8
0
 private void dg_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     _lst.Clear();
     if (dg.SelectedIndex > -1)
     {
         T_OA_CONSERVATION vd = dg.SelectedItem as T_OA_CONSERVATION;
         //vd.T_OA_VEHICLE = cmbVehicleInfo.SelectedItem as T_OA_VEHICLE;
         _lst.Add(vd);
     }
 }
Beispiel #9
0
        [OperationContract]   //add by zl
        public int AddConserVation_i(T_OA_CONSERVATION cvInfo)
        {
            ConserVationManagementBll cvmBll = new ConserVationManagementBll();

            if (cvmBll.AddInfo(cvInfo) == true)
            {
                return(1);
            }
            return(-1);
        }
Beispiel #10
0
        private void SetFormDefailValue(T_OA_CONSERVATION defaultInfo)
        {
            conserVation = defaultInfo;
            if (!string.IsNullOrEmpty(conserVation.OWNERCOMPANYID))
            {
                Utility.SetComboboxSelectByText(cmbConserVationName, conserVation.CONSERVATYPE, -1);
                txtContent.Text     = conserVation.CONTENT;
                txtFee.Text         = conserVation.CHARGEMONEY.ToString();
                ckbHasFee.IsChecked = conserVation.ISCHARGE == "1" ? true : false;

                if (types == FormTypes.Resubmit)//重新提交
                {
                    conserVation.CHECKSTATE = (Convert.ToInt32(CheckStates.UnSubmit)).ToString();
                }
                RefreshUI(RefreshedTypes.AuditInfo);
                RefreshUI(RefreshedTypes.All);
            }
        }
        void BtnView_Click(object sender, RoutedEventArgs e)
        {
            ObservableCollection <T_OA_CONSERVATION> selectInfoList = GetSelectList();

            if (selectInfoList != null && selectInfoList.Count > 0)
            {
                selApporvalInfo = selectInfoList.FirstOrDefault();
                ConserVationForm_aud form = new ConserVationForm_aud(FormTypes.Browse, selApporvalInfo.CONSERVATIONID);
                form.ConserVation = selectInfoList[0];
                EntityBrowser browser = new EntityBrowser(form);
                browser.FormType         = FormTypes.Browse;
                browser.MinWidth         = 750;
                browser.MinHeight        = 420;
                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", "VIEW"));
            }
        }
Beispiel #12
0
        private void AddInfo()
        {
            T_OA_CONSERVATION info = new T_OA_CONSERVATION();

            info.T_OA_VEHICLE = (T_OA_VEHICLE)cmbVehicleAssetId.SelectedItem;
            info.CHECKSTATE   = conserVation.CHECKSTATE;
            info.CONSERVATYPE = ((SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY)cmbConserVationName.SelectedItem).DICTIONARYNAME.ToString();

            info.CONSERVATIONID      = conserVation.CONSERVATIONID;
            info.TEL                 = txtTel.Text;
            info.CONTENT             = txtContent.Text;
            info.REMARK              = txtReMark.Text;
            info.CONSERVATIONCOMPANY = txtREPAIRCOMPANY.Text;
            info.CONSERVATIONRANGE   = txtCONSERVATIONRANGE.Text.Trim() == "" ? 0 : int.Parse(txtCONSERVATIONRANGE.Text);
            info.REPAIRDATE          = DateTime.Parse(dateREPAIRDATE.Text);
            info.RETRIEVEDATE        = DateTime.Parse(dateRETRIEVEDATE.Text);


            info.ISCHARGE            = ckbHasFee.IsChecked == true ? "1" : "0";
            conserVation.CHARGEMONEY = ckbHasFee.IsChecked == true ? fbCtr.ExtensionalOrder.TOTALMONEY : 0;

            info.CREATEDATE         = System.DateTime.Now;
            info.CREATECOMPANYID    = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            info.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
            info.CREATEPOSTID       = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
            info.CREATEUSERID       = Common.CurrentLoginUserInfo.EmployeeID;
            info.CREATEUSERNAME     = Common.CurrentLoginUserInfo.EmployeeName;
            info.OWNERCOMPANYID     = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            info.OWNERDEPARTMENTID  = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
            info.OWNERPOSTID        = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
            info.OWNERID            = Common.CurrentLoginUserInfo.EmployeeID;
            info.OWNERNAME          = Common.CurrentLoginUserInfo.EmployeeName;
            info.UPDATEDATE         = System.DateTime.Now;
            info.UPDATEUSERID       = Common.CurrentLoginUserInfo.EmployeeID;
            info.UPDATEUSERNAME     = Common.CurrentLoginUserInfo.EmployeeName;
            conserVation            = info;
            _VM.AddConserVationAsync(info);
        }
Beispiel #13
0
        private void UpdateInfo(T_OA_CONSERVATION info)
        {
            info.T_OA_VEHICLE = (T_OA_VEHICLE)cmbVehicleAssetId.SelectedItem;
            info.CONSERVATYPE = ((SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY)cmbConserVationName.SelectedItem).DICTIONARYNAME.ToString();

            info.TEL                 = txtTel.Text;
            info.CONTENT             = txtContent.Text;
            info.REMARK              = txtReMark.Text;
            info.CONSERVATIONCOMPANY = txtREPAIRCOMPANY.Text;
            info.REPAIRDATE          = DateTime.Parse(dateREPAIRDATE.Text);
            info.RETRIEVEDATE        = DateTime.Parse(dateRETRIEVEDATE.Text);
            info.CONSERVATIONRANGE   = txtCONSERVATIONRANGE.Text.Trim() == "" ? 0 : int.Parse(txtCONSERVATIONRANGE.Text);
            info.ISCHARGE            = ckbHasFee.IsChecked == true ? "1" : "0";
            //***************************************************************************************************
            ////******************************************************************************************************************************
            info.CHARGEMONEY = ckbHasFee.IsChecked == true ? fbCtr.ExtensionalOrder.TOTALMONEY : 0;
            // info.CHARGEMONEY = ckbHasFee.IsChecked == true ? Convert.ToDecimal(txtFee.Text) : 0;

            info.UPDATEDATE   = System.DateTime.Now;
            info.UPDATEUSERID = Common.CurrentLoginUserInfo.EmployeeID;

            _VM.UpdateConserVationAsync(info, "Edit");
        }
 private void btnDelete_Click(object sender, RoutedEventArgs e)
 {
     selectDeleteList = GetSelectList();
     if (selectDeleteList == null)
     {
         ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON"));
         return;
     }
     for (int i = 0; i < dg.SelectedItems.Count; i++)
     {
         selApporvalInfo = selectDeleteList[i];
         if (selApporvalInfo.CHECKSTATE == ((int)CheckStates.UnSubmit).ToString())
         {
             string        Result = "";
             ComfirmWindow com    = new ComfirmWindow();
             com.OnSelectionBoxClosed += (obj, result) =>
             {
                 if (selectDeleteList != null)
                 {
                     try
                     {
                         cvmWS.DeleteConserVationListAsync(selectDeleteList);
                     }
                     catch
                     {
                     }
                 }
             };
             com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
         }
         else
         {
             Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTONLYDIDNOSUBMITANDREVIEWTHEDATACANBEDELETEDBY"));
             return;
         }
     }
 }
Beispiel #15
0
        public void DoAction(string actionType)
        {
            if (cmbVehicleAssetId.SelectedIndex < 0)
            {
                Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARNING"), Utility.GetResourceStr("PLEASESELECT", "Vehicle"));
                return;
            }
            if (cmbConserVationName.SelectedIndex < 0)
            {
                Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARNING"), Utility.GetResourceStr("PLEASESELECT", "ConserVationName"));
                return;
            }
            if (string.IsNullOrEmpty(txtCONSERVATIONRANGE.Text))
            {
                Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARNING"), Utility.GetResourceStr("REQUIRED", "CONSERVATIONRANGE"));
                return;
            }
            else
            {
                //判断是否为整数
                int iResult = 0;
                if (!int.TryParse(txtCONSERVATIONRANGE.Text.Trim(), out iResult))
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("FORMATERROR", "CONSERVATIONRANGE"));
                    return;
                }

            }
            if (ckbHasFee.IsChecked == true)
            {
                if (string.IsNullOrEmpty(txtFee.Text))
                {
                    Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARNING"), Utility.GetResourceStr("REQUIRED", "MaintenanceFees"));
                    return;
                }
                if (!CheckInputIsDecimal(txtFee.Text.Trim()))
                {
                    Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARNING"), Utility.GetResourceStr("IsDouble", "MaintenanceFees"));
                    return;
                }
            }
            if (types == FormTypes.New)
            {
                conserVation = new T_OA_CONSERVATION();
                conserVation.CHECKSTATE = ((int)CheckStates.UnSubmit).ToString();
                conserVation.CONSERVATIONID = System.Guid.NewGuid().ToString();
            }
            if (!Check()) return;
            RefreshUI(RefreshedTypes.ShowProgressBar);
            switch (actionType)
            {
                case "0":
                    _flwResult = SMT.SaaS.FrameworkUI.CheckStates.UnSubmit;
                    saveType = RefreshedTypes.HideProgressBar;
                    Save();
                    break;
                case "1":
                    _flwResult = SMT.SaaS.FrameworkUI.CheckStates.UnSubmit;
                    saveType = RefreshedTypes.CloseAndReloadData;
                    Save();
                    break;
            }
        }
Beispiel #16
0
        void Get_VConserVationCompleted(object sender, Get_VConserVationCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                conserVation = e.Result;

                if (conserVation != null)
                {
                    Utility.SetComboboxSelectByText(cmbConserVationName, conserVation.CONSERVATYPE, -1);
                    txtContent.Text = conserVation.CONTENT;
                    txtFee.Text = conserVation.CHARGEMONEY.ToString();
                    ckbHasFee.IsChecked = conserVation.ISCHARGE == "1" ? true : false;

                    txtContent.IsEnabled = true;
                    txtFee.IsEnabled = true;
                    cmbConserVationName.IsEnabled = false;

                    RefreshUI(RefreshedTypes.AuditInfo);
                    RefreshUI(RefreshedTypes.All);
                    //InitAudit(conserVation.CONSERVATIONID);
                    InitFBControl();
                    //viewApproval.XmlObject = DataObjectToXml<T_OA_CONSERVATION>.ObjListToXml(conserVation, "OA");
                }
            }
        }
Beispiel #17
0
        public void DoAction(string actionType)
        {
            if (cmbVehicleAssetId.SelectedIndex < 0)
            {
                Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARNING"), Utility.GetResourceStr("PLEASESELECT", "Vehicle"));
                return;
            }
            if (cmbConserVationName.SelectedIndex < 0)
            {
                Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARNING"), Utility.GetResourceStr("PLEASESELECT", "ConserVationName"));
                return;
            }
            if (string.IsNullOrEmpty(txtCONSERVATIONRANGE.Text))
            {
                Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARNING"), Utility.GetResourceStr("REQUIRED", "CONSERVATIONRANGE"));
                return;
            }
            else
            {
                //判断是否为整数
                int iResult = 0;
                if (!int.TryParse(txtCONSERVATIONRANGE.Text.Trim(), out iResult))
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("FORMATERROR", "CONSERVATIONRANGE"));
                    return;
                }
            }
            if (ckbHasFee.IsChecked == true)
            {
                if (string.IsNullOrEmpty(txtFee.Text))
                {
                    Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARNING"), Utility.GetResourceStr("REQUIRED", "MaintenanceFees"));
                    return;
                }
                if (!CheckInputIsDecimal(txtFee.Text.Trim()))
                {
                    Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("WARNING"), Utility.GetResourceStr("IsDouble", "MaintenanceFees"));
                    return;
                }
            }
            if (types == FormTypes.New)
            {
                conserVation                = new T_OA_CONSERVATION();
                conserVation.CHECKSTATE     = ((int)CheckStates.UnSubmit).ToString();
                conserVation.CONSERVATIONID = System.Guid.NewGuid().ToString();
            }
            if (!Check())
            {
                return;
            }
            RefreshUI(RefreshedTypes.ShowProgressBar);
            switch (actionType)
            {
            case "0":
                _flwResult = SMT.SaaS.FrameworkUI.CheckStates.UnSubmit;
                saveType   = RefreshedTypes.HideProgressBar;
                Save();
                break;

            case "1":
                _flwResult = SMT.SaaS.FrameworkUI.CheckStates.UnSubmit;
                saveType   = RefreshedTypes.CloseAndReloadData;
                Save();
                break;
            }
        }
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            selectDeleteList = GetSelectList();
            if (selectDeleteList == null)
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON"));
                return;
            }
            for (int i = 0; i < dg.SelectedItems.Count; i++)
            {
                selApporvalInfo = selectDeleteList[i];
                if (selApporvalInfo.CHECKSTATE == ((int)CheckStates.UnSubmit).ToString())
                {
                    string Result = "";
                    ComfirmWindow com = new ComfirmWindow();
                    com.OnSelectionBoxClosed += (obj, result) =>
                    {

                        if (selectDeleteList != null)
                        {
                            try
                            {
                                cvmWS.DeleteConserVationListAsync(selectDeleteList);
                            }
                            catch
                            {

                            }
                        }
                    };
                    com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
                }
                else
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTONLYDIDNOSUBMITANDREVIEWTHEDATACANBEDELETEDBY"));
                    return;
                }
            }
        }
Beispiel #19
0
        private void AddInfo()
        {
            T_OA_CONSERVATION info = new T_OA_CONSERVATION();
            info.T_OA_VEHICLE = (T_OA_VEHICLE)cmbVehicleAssetId.SelectedItem;
            info.CHECKSTATE = conserVation.CHECKSTATE;
            info.CONSERVATYPE = ((SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY)cmbConserVationName.SelectedItem).DICTIONARYNAME.ToString();

            info.CONSERVATIONID = conserVation.CONSERVATIONID;
            info.TEL = txtTel.Text;
            info.CONTENT = txtContent.Text;
            info.REMARK = txtReMark.Text;
            info.CONSERVATIONCOMPANY = txtREPAIRCOMPANY.Text;
            info.CONSERVATIONRANGE = txtCONSERVATIONRANGE.Text.Trim() == "" ? 0 : int.Parse(txtCONSERVATIONRANGE.Text);
            info.REPAIRDATE = DateTime.Parse(dateREPAIRDATE.Text);
            info.RETRIEVEDATE = DateTime.Parse(dateRETRIEVEDATE.Text);


            info.ISCHARGE = ckbHasFee.IsChecked == true ? "1" : "0";
            conserVation.CHARGEMONEY = ckbHasFee.IsChecked == true ? fbCtr.Order.TOTALMONEY : 0;

            info.CREATEDATE = System.DateTime.Now;
            info.CREATECOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            info.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
            info.CREATEPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
            info.CREATEUSERID = Common.CurrentLoginUserInfo.EmployeeID;
            info.CREATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName;
            info.OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            info.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
            info.OWNERPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
            info.OWNERID = Common.CurrentLoginUserInfo.EmployeeID;
            info.OWNERNAME = Common.CurrentLoginUserInfo.EmployeeName;
            info.UPDATEDATE = System.DateTime.Now;
            info.UPDATEUSERID = Common.CurrentLoginUserInfo.EmployeeID;
            info.UPDATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName;
            conserVation = info;
            _VM.AddConserVationAsync(info);
        }
Beispiel #20
0
        private void UpdateInfo(T_OA_CONSERVATION info)
        {
            info.T_OA_VEHICLE = (T_OA_VEHICLE)cmbVehicleAssetId.SelectedItem;
            info.CONSERVATYPE = ((SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY)cmbConserVationName.SelectedItem).DICTIONARYNAME.ToString();

            info.TEL = txtTel.Text;
            info.CONTENT = txtContent.Text;
            info.REMARK = txtReMark.Text;
            info.CONSERVATIONCOMPANY = txtREPAIRCOMPANY.Text;
            info.REPAIRDATE = DateTime.Parse(dateREPAIRDATE.Text);
            info.RETRIEVEDATE = DateTime.Parse(dateRETRIEVEDATE.Text);
            info.CONSERVATIONRANGE = txtCONSERVATIONRANGE.Text.Trim() == "" ? 0 : int.Parse(txtCONSERVATIONRANGE.Text);
            info.ISCHARGE = ckbHasFee.IsChecked == true ? "1" : "0";
            //***************************************************************************************************
            ////******************************************************************************************************************************
            info.CHARGEMONEY = ckbHasFee.IsChecked == true ? fbCtr.Order.TOTALMONEY : 0;
            // info.CHARGEMONEY = ckbHasFee.IsChecked == true ? Convert.ToDecimal(txtFee.Text) : 0;

            info.UPDATEDATE = System.DateTime.Now;
            info.UPDATEUSERID = Common.CurrentLoginUserInfo.EmployeeID;

            _VM.UpdateConserVationAsync(info, "Edit");
        }
Beispiel #21
0
        private void SetFormDefailValue(T_OA_CONSERVATION defaultInfo)
        {
            conserVation = defaultInfo;
            if (!string.IsNullOrEmpty(conserVation.OWNERCOMPANYID))
            {
                Utility.SetComboboxSelectByText(cmbConserVationName, conserVation.CONSERVATYPE, -1);
                txtContent.Text = conserVation.CONTENT;
                txtFee.Text = conserVation.CHARGEMONEY.ToString();
                ckbHasFee.IsChecked = conserVation.ISCHARGE == "1" ? true : false;

                if (types == FormTypes.Resubmit)//重新提交
                {
                    conserVation.CHECKSTATE = (Convert.ToInt32(CheckStates.UnSubmit)).ToString();
                }
                RefreshUI(RefreshedTypes.AuditInfo);
                RefreshUI(RefreshedTypes.All);
            }
        }
Beispiel #22
0
 private int UpdateConserVation(T_OA_CONSERVATION cvInfo)
 {
     ConserVationManagementBll cvmBll = new ConserVationManagementBll();
     if (cvmBll.UpdateInfo(cvInfo) == -1)
     {
         return -1;
     }
     return 1;
 }
 void BtnView_Click(object sender, RoutedEventArgs e)
 {
     ObservableCollection<T_OA_CONSERVATION> selectInfoList = GetSelectList();
     if (selectInfoList != null && selectInfoList.Count > 0)
     {
         selApporvalInfo = selectInfoList.FirstOrDefault();
         ConserVationForm_aud form = new ConserVationForm_aud(FormTypes.Browse, selApporvalInfo.CONSERVATIONID);
         form.ConserVation = selectInfoList[0];
         EntityBrowser browser = new EntityBrowser(form);
         browser.FormType = FormTypes.Browse;
         browser.MinWidth = 750;
         browser.MinHeight = 420;
         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", "VIEW"));
     }
 }
Beispiel #24
0
        //----------------------------------add by zl
        #region 根据传回的XML,添加保养申请
        /// <summary>
        /// 根据传回的XML,添加保养申请
        /// </summary>
        /// <param name="xele"></param>
        private static string ConservationAdd(IEnumerable<XElement> eGFunc)
        {
            try
            {
                if (eGFunc.Count() == 0)
                {
                    return "";
                }
                string strEmployeeID = string.Empty;
                string strOwnerID = string.Empty;
                string strOwnerPostID = string.Empty;
                string strOwnerDepartmentID = string.Empty;
                string strOwnerCompanyID = string.Empty;

                foreach (var q in eGFunc)
                {
                    string strName = q.Attribute("Name").Value;
                    switch (strName)
                    {
                        case "CREATEUSERID":
                            strEmployeeID = q.Attribute("Value").Value;
                            break;
                        case "OWNERID":
                            strOwnerID = q.Attribute("Value").Value;
                            break;
                        case "OWNERPOSTID":
                            strOwnerPostID = q.Attribute("Value").Value;
                            break;
                        case "OWNERDEPARTMENTID":
                            strOwnerDepartmentID = q.Attribute("Value").Value;
                            break;
                        case "OWNERCOMPANYID":
                            strOwnerCompanyID = q.Attribute("Value").Value;
                            break;
                    }
                }

                string employeeid = strEmployeeID.Replace("{", "").Replace("}", "");

                T_OA_CONSERVATION entity = new T_OA_CONSERVATION();
                entity.CONSERVATIONID = Guid.NewGuid().ToString();

                SmtOACommonAdmin oa = new SmtOACommonAdmin();
                //VehicleDispatchManageBll oa = new VehicleDispatchManageBll();
                List<T_OA_VEHICLE> vehicleInfoList = oa.GetVehicleInfoList();

                entity.T_OA_VEHICLE = vehicleInfoList[0];

                entity.CREATEDATE = DateTime.Now;
                entity.OWNERID = strOwnerID;
                entity.OWNERPOSTID = strOwnerPostID;
                entity.OWNERDEPARTMENTID = strOwnerDepartmentID;
                entity.OWNERCOMPANYID = strOwnerCompanyID;
                entity.CREATEUSERID = strOwnerID;
                entity.CREATEPOSTID = strOwnerPostID;
                entity.CREATEDEPARTMENTID = strOwnerDepartmentID;
                entity.CREATECOMPANYID = strOwnerCompanyID;

                int i = oa.AddConserVation_i(entity);
                if (i > 0)
                {
                    return entity.CONSERVATIONID;
                }
                else
                {
                    string err = "Error";
                    return err;
                }
            }
            catch (Exception e)
            {
                string abc = "<OA>Message=[" + e.Message + "]" + "<OA>Source=[" + e.Source + "]<OA>StackTrace=[" + e.StackTrace + "]<OA>TargetSite=[" + e.TargetSite + "]";
                Tracer.Debug(abc);
                return abc;
            }
        }
 //编辑
 private void btnEdit_Click(object sender, RoutedEventArgs e)
 {
     ObservableCollection<T_OA_CONSERVATION> selectInfoList = GetSelectList();
     if (selectInfoList != null && selectInfoList.Count > 0)
     {
         selApporvalInfo = selectInfoList[0];
         if (selApporvalInfo.CHECKSTATE == ((int)CheckStates.UnSubmit).ToString() || selApporvalInfo.CHECKSTATE == ((int)CheckStates.UnApproved).ToString())
         {
             ConserVationForm form = new ConserVationForm(FormTypes.Edit);
             form.EditState = "update";
             form.ConserVation = selectInfoList[0];
             EntityBrowser browser = new EntityBrowser(form);
             browser.FormType = FormTypes.Edit;
             browser.MinWidth = 750;
             browser.MinHeight = 420;
             browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent);
             browser.Show<string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }, true);
         }
         else
         {
             Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTONLYCANMODIFYTHEDATASUBMITTED"));
             return;
         }
     }
     else
     {
         Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTERROR", "UPDATE"));
     }
 }