//获取详细信息
        private void Get_VDRecordCompleted(object sender, Get_VDRecordCompletedEventArgs e)
        {
            ObservableCollection<T_OA_VEHICLEDISPATCHRECORD> o = e.Result;
            _lstRecord.AddRange(o);
            vehicleDispatchRecord = e.Result[0];
            txtVehicleInfo.Text = _lstRecord[0].T_OA_VEHICLEDISPATCHDETAIL.T_OA_VEHICLEDISPATCH.T_OA_VEHICLE.VIN;
            txtNum.Text = _lstRecord[0].NUM;
            dtiStartDate.DateTimeValue = Convert.ToDateTime(_lstRecord[0].STARTTIME);
            dtiEndDate.DateTimeValue = Convert.ToDateTime(_lstRecord[0].ENDTIME);
            txtDriverID.Text = _lstRecord[0].OWNERID;
            txtDriverName.Text = _lstRecord[0].OWNERNAME;
            txtTel.Text = _lstRecord[0].TEL;
            txtRoute.Text = _lstRecord[0].ROUTE;
            txtREMARK.Text = _lstRecord[0].CONTENT == null ? "" : _lstRecord[0].CONTENT;
            txtFuel.Text = _lstRecord[0].FUEL.ToString();
            ckbHasFee.IsChecked = _lstRecord[0].ISCHARGE == "0" ? false : true;
            txtFee.Text = _lstRecord[0].CHARGEMONEY.ToString();
            txtRange2.Text = _lstRecord[0].RANGE.ToString();

            if (types == FormTypes.Resubmit)//重新提交
            {
                _lstRecord[0].CHECKSTATE = (Convert.ToInt32(CheckStates.UnSubmit)).ToString();
            }
            RefreshUI(RefreshedTypes.AuditInfo);
            RefreshUI(RefreshedTypes.All);
            InitFBControl();
        }
        public VehicleDispatchRecord_add(FormTypes type)
        {
            InitializeComponent();
            _record = new T_OA_VEHICLEDISPATCHRECORD();
            _record.CHECKSTATE = ((int)CheckStates.UnSubmit).ToString();
            this.types = type;
            _VM.Add_VDRecordCompleted += new EventHandler<Add_VDRecordCompletedEventArgs>(Add_VDRecordCompleted);
            _VM.Upd_VDRecordCompleted += new EventHandler<Upd_VDRecordCompletedEventArgs>(Upd_VDRecordCompleted);
            //车辆
            _VM.GetCanUseVehicleInfoListCompleted += new EventHandler<GetCanUseVehicleInfoListCompletedEventArgs>(GetCanUseVehicleInfoListCompleted);
            //派车单
            _VM.Get_VDInfoCompleted += new EventHandler<Get_VDInfoCompletedEventArgs>(Get_VDInfoCompleted);
            _VM.Del_VDDetailsCompleted += new EventHandler<Del_VDDetailsCompletedEventArgs>(Del_VDDetailsCompleted);
            fbCtr.SaveCompleted += new EventHandler<SMT.SaaS.FrameworkUI.FBControls.ChargeApplyControl.SaveCompletedArgs>(fbCtr_SaveCompleted);

            personclient.GetEmployeeDetailByIDCompleted += new EventHandler<GetEmployeeDetailByIDCompletedEventArgs>(personclient_GetEmployeeDetailByIDCompleted);
            
        }
 void btnReSubmit_Click(object sender, RoutedEventArgs e)
 {
     ObservableCollection<T_OA_VEHICLEDISPATCHRECORD> selectItems = GetSelectList();
     if (selectItems != null)
     {
         vehicledispatchrecord = selectItems.FirstOrDefault();
         VehicleDispatchRecord_upd form = new VehicleDispatchRecord_upd(FormTypes.Resubmit, vehicledispatchrecord.VEHICLEDISPATCHRECORDID);
         form.VehicleDispatchRecord = selectItems[0];
         EntityBrowser browser = new EntityBrowser(form);
         browser.FormType = FormTypes.Resubmit;
         browser.MinWidth = 750;
         browser.MinHeight = 600;
         browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent);
         browser.Show<string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }, true);
     }
     else
         ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "ReSubmit"), Utility.GetResourceStr("CONFIRMBUTTON"));
 }
        private ObservableCollection <T_OA_VEHICLEDISPATCHRECORD> deletedList = new ObservableCollection <T_OA_VEHICLEDISPATCHRECORD>();//标记被删除的对象

        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            ObservableCollection <T_OA_VEHICLEDISPATCHRECORD> selectItems = GetSelectList();
            ObservableCollection <string> o = new ObservableCollection <string>();

            if (selectItems != null)
            {
                for (int i = 0; i < dg.SelectedItems.Count; i++)
                {
                    vehicledispatchrecord = selectItems[i];
                    if (vehicledispatchrecord.CHECKSTATE == ((int)CheckStates.UnSubmit).ToString())
                    {
                        string        Result = "";
                        ComfirmWindow com    = new ComfirmWindow();
                        com.OnSelectionBoxClosed += (obj, result) =>
                        {
                            try
                            {
                                foreach (T_OA_VEHICLEDISPATCHRECORD info in selectItems)
                                {
                                    o.Add(info.VEHICLEDISPATCHRECORDID);
                                }
                                vehicleDispatchManager.Del_VDRecordAsync(o);
                            }
                            catch
                            {
                            }
                        };
                        com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
                    }
                    else
                    {
                        Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTONLYDIDNOSUBMITANDREVIEWTHEDATACANBEDELETEDBY"));
                        return;
                    }
                }
            }
            else
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON"));
            }
        }
        //获取详细信息
        private void Get_VDRecordCompleted(object sender, Get_VDRecordCompletedEventArgs e)
        {
            ObservableCollection <T_OA_VEHICLEDISPATCHRECORD> o = e.Result;

            _lstRecord.AddRange(o);
            vehicleDispatchRecord = e.Result[0];

            txtVehicleInfo.Text        = _lstRecord[0].T_OA_VEHICLEDISPATCHDETAIL.T_OA_VEHICLEDISPATCH.T_OA_VEHICLE.VIN;
            txtNum.Text                = _lstRecord[0].NUM;
            dtiStartDate.DateTimeValue = Convert.ToDateTime(_lstRecord[0].STARTTIME);
            dtiEndDate.DateTimeValue   = Convert.ToDateTime(_lstRecord[0].ENDTIME);
            txtDriverID.Text           = _lstRecord[0].OWNERID;
            txtDriverName.Text         = _lstRecord[0].OWNERNAME;
            txtTel.Text                = _lstRecord[0].TEL;
            txtRoute.Text              = _lstRecord[0].ROUTE;
            txtREMARK.Text             = _lstRecord[0].CONTENT == null ? "" : _lstRecord[0].CONTENT;
            txtFuel.Text               = _lstRecord[0].FUEL.ToString();
            ckbHasFee.IsChecked        = _lstRecord[0].ISCHARGE == "0" ? false : true;
            txtFee.Text                = _lstRecord[0].CHARGEMONEY.ToString();
            txtRange2.Text             = _lstRecord[0].RANGE.ToString();
        }
Beispiel #6
0
        /// <summary>
        ///  dg 选择事件
        /// </summary>
        private void RdoSelect(T_OA_VEHICLEDISPATCHRECORD r)
        {
            _record = r;
            cmbVehicleInfo.SelectedItem = r.T_OA_VEHICLEDISPATCHDETAIL.T_OA_VEHICLEDISPATCH.T_OA_VEHICLE;
            txtNum.Text = r.NUM;
            dtiStartDate.DateTimeValue = Convert.ToDateTime(r.STARTTIME);
            dtiEndDate.DateTimeValue   = Convert.ToDateTime(r.ENDTIME);
            txtTel.Text    = r.TEL;
            txtRoute.Text  = r.ROUTE;
            txtFuel.Text   = r.FUEL.ToString();
            txtRange2.Text = r.RANGE.ToString();
            //ckbHasFee.IsChecked = r.ISCHARGE == "0" ? false : true;
            //txtFee.Text = r.CHARGEMONEY.ToString();
            txtREMARK.Text = r.CONTENT;

            txtREASON.Text = r.T_OA_VEHICLEDISPATCHDETAIL.T_OA_VEHICLEDISPATCH.CONTENT;
            //有用
            txtDriverID.Text = r.T_OA_VEHICLEDISPATCHDETAIL.T_OA_VEHICLEDISPATCH.DRIVER;
            // txtDriverName.Text = r.T_OA_VEHICLEDISPATCHDETAIL.T_OA_VEHICLEDISPATCH.DRIVER;
            PersonnelServiceClient client = new PersonnelServiceClient();

            client.GetEmployeeByIDAsync(r.T_OA_VEHICLEDISPATCHDETAIL.T_OA_VEHICLEDISPATCH.DRIVER);
            client.GetEmployeeByIDCompleted += new EventHandler <GetEmployeeByIDCompletedEventArgs>(client_GetEmployeeByIDCompleted);
        }
Beispiel #7
0
        //获取已经派车的申请用车数据
        void Get_VDInfoCompleted(object sender, Get_VDInfoCompletedEventArgs e)
        {
            try
            {
                if (e.Error != null && e.Error.Message != "")
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(e.Error.Message));
                }
                _lstVRecord.Clear();
                ObservableCollection <T_OA_VEHICLEDISPATCH> lst = e.Result;
                if (lst != null)
                {
                    foreach (T_OA_VEHICLEDISPATCHDETAIL info in lst[0].T_OA_VEHICLEDISPATCHDETAIL.ToList())
                    //foreach (T_OA_VEHICLEDISPATCHDETAIL info in lst[0].tToList())
                    {
                        T_OA_VEHICLEDISPATCHRECORD r = new T_OA_VEHICLEDISPATCHRECORD();
                        r.T_OA_VEHICLEDISPATCHDETAIL = info;
                        r.T_OA_VEHICLEDISPATCHDETAIL.T_OA_VEHICLEDISPATCH = info.T_OA_VEHICLEDISPATCH;

                        r.T_OA_VEHICLEDISPATCHDETAIL.VEHICLEDISPATCHDETAILID = info.VEHICLEDISPATCHDETAILID;
                        r.T_OA_VEHICLEDISPATCHDETAIL.T_OA_VEHICLEDISPATCH.VEHICLEDISPATCHID = info.T_OA_VEHICLEDISPATCH.VEHICLEDISPATCHID;
                        r.T_OA_VEHICLEDISPATCHDETAIL.T_OA_VEHICLEDISPATCH.DRIVER            = info.T_OA_VEHICLEDISPATCH.DRIVER;
                        r.T_OA_VEHICLEDISPATCHDETAIL.T_OA_VEHICLEDISPATCH.T_OA_VEHICLE      = frmD._lstVDispatch[0].T_OA_VEHICLE;

                        r.STARTTIME = info.T_OA_VEHICLEDISPATCH.STARTTIME;
                        r.ENDTIME   = info.T_OA_VEHICLEDISPATCH.ENDTIME;
                        r.NUM       = info.T_OA_VEHICLEDISPATCH.NUM;
                        r.ROUTE     = info.T_OA_VEHICLEDISPATCH.ROUTE;
                        r.TEL       = info.T_OA_VEHICLEDISPATCH.TEL;

                        r.FUEL    = decimal.Parse("0.00");
                        r.RANGE   = decimal.Parse("0.00");
                        r.CONTENT = "";
                        //r.ISCHARGE = ckbHasFee.IsChecked == true ? "1" : "0";
                        //r.CHARGEMONEY = txtFee.Text == "" ? decimal.Parse("0.00") : decimal.Parse(txtFee.Text);

                        r.CREATECOMPANYID    = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                        r.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                        r.CREATEUSERID       = Common.CurrentLoginUserInfo.EmployeeID;
                        r.CREATEUSERNAME     = Common.CurrentLoginUserInfo.EmployeeName;
                        r.CREATEPOSTID       = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                        r.CREATEDATE         = DateTime.Now;

                        r.OWNERCOMPANYID    = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                        r.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                        r.OWNERID           = Common.CurrentLoginUserInfo.EmployeeID;
                        r.OWNERNAME         = Common.CurrentLoginUserInfo.EmployeeName;
                        r.OWNERPOSTID       = Common.CurrentLoginUserInfo.UserPosts[0].PostID;

                        r.CHECKSTATE = "0";
                        _lstVRecord.Add(r);
                    }
                    if (_lstVRecord.Count > 0)
                    {
                        dg.ItemsSource   = _lstVRecord;
                        dg.SelectedIndex = 0;

                        RdoSelect(_lstVRecord[0]);
                    }
                }
            }
            catch (Exception ex)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.ToString());
            }
        }
Beispiel #8
0
        /// <summary>
        /// 根据传回的XML,添加派车记录
        /// </summary>
        /// <param name="xele"></param>
        private static string VehicledispatchrecordAdd(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_VEHICLEDISPATCHRECORD entity = new T_OA_VEHICLEDISPATCHRECORD();
                entity.VEHICLEDISPATCHRECORDID = Guid.NewGuid().ToString();

                VehicleDispatchManageBll vehicleDispatchManagerBll = new VehicleDispatchManageBll();
                List<T_OA_VEHICLEDISPATCH> vehicleDispatchList = vehicleDispatchManagerBll.Gets_VDAndDetail(string.Empty, string.Empty, null);

                entity.T_OA_VEHICLEDISPATCHDETAIL = vehicleDispatchList[0].T_OA_VEHICLEDISPATCHDETAIL.FirstOrDefault();
                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;

                List<T_OA_VEHICLEDISPATCHRECORD> lst = new List<T_OA_VEHICLEDISPATCHRECORD>();
                lst.Add(entity);
                int i = vehicleDispatchManagerBll.Add_VDRecord(lst);
                if (i > 0)
                {
                    return entity.VEHICLEDISPATCHRECORDID;
                }
                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 Get_VDRecordCompleted(object sender, Get_VDRecordCompletedEventArgs e)
        {
            ObservableCollection<T_OA_VEHICLEDISPATCHRECORD> o = e.Result;
            _lstRecord.AddRange(o);
            vehicleDispatchRecord = e.Result[0];

            txtVehicleInfo.Text = _lstRecord[0].T_OA_VEHICLEDISPATCHDETAIL.T_OA_VEHICLEDISPATCH.T_OA_VEHICLE.VIN;
            txtNum.Text = _lstRecord[0].NUM;
            dtiStartDate.DateTimeValue = Convert.ToDateTime(_lstRecord[0].STARTTIME);
            dtiEndDate.DateTimeValue = Convert.ToDateTime(_lstRecord[0].ENDTIME);
            txtDriverID.Text = _lstRecord[0].OWNERID;
            txtDriverName.Text = _lstRecord[0].OWNERNAME;
            txtTel.Text = _lstRecord[0].TEL;
            txtRoute.Text = _lstRecord[0].ROUTE;
            txtREMARK.Text = _lstRecord[0].CONTENT == null ? "" : _lstRecord[0].CONTENT;
            txtFuel.Text = _lstRecord[0].FUEL.ToString();
            ckbHasFee.IsChecked = _lstRecord[0].ISCHARGE == "0" ? false : true;
            txtFee.Text = _lstRecord[0].CHARGEMONEY.ToString();
            txtRange2.Text = _lstRecord[0].RANGE.ToString();
        }
        /// <summary>
        ///  dg 选择事件
        /// </summary>
        private void RdoSelect(T_OA_VEHICLEDISPATCHRECORD r)
        {
            _record = r;
            cmbVehicleInfo.SelectedItem = r.T_OA_VEHICLEDISPATCHDETAIL.T_OA_VEHICLEDISPATCH.T_OA_VEHICLE;
            txtNum.Text = r.NUM;
            dtiStartDate.DateTimeValue = Convert.ToDateTime(r.STARTTIME);
            dtiEndDate.DateTimeValue = Convert.ToDateTime(r.ENDTIME);
            txtTel.Text = r.TEL;
            txtRoute.Text = r.ROUTE;
            txtFuel.Text = r.FUEL.ToString();
            txtRange2.Text = r.RANGE.ToString();
            //ckbHasFee.IsChecked = r.ISCHARGE == "0" ? false : true;
            //txtFee.Text = r.CHARGEMONEY.ToString();
            txtREMARK.Text = r.CONTENT;

            txtREASON.Text = r.T_OA_VEHICLEDISPATCHDETAIL.T_OA_VEHICLEDISPATCH.CONTENT;
            //有用
            txtDriverID.Text = r.T_OA_VEHICLEDISPATCHDETAIL.T_OA_VEHICLEDISPATCH.DRIVER;
            // txtDriverName.Text = r.T_OA_VEHICLEDISPATCHDETAIL.T_OA_VEHICLEDISPATCH.DRIVER;
            PersonnelServiceClient client = new PersonnelServiceClient();
            client.GetEmployeeByIDAsync(r.T_OA_VEHICLEDISPATCHDETAIL.T_OA_VEHICLEDISPATCH.DRIVER);
            client.GetEmployeeByIDCompleted += new EventHandler<GetEmployeeByIDCompletedEventArgs>(client_GetEmployeeByIDCompleted);
        }
        //获取已经派车的申请用车数据
        void Get_VDInfoCompleted(object sender, Get_VDInfoCompletedEventArgs e)
        {
            try
            {
                if (e.Error != null && e.Error.Message != "")
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(e.Error.Message));
                }
                _lstVRecord.Clear();
                ObservableCollection<T_OA_VEHICLEDISPATCH> lst = e.Result;
                if (lst != null)
                {
                    foreach (T_OA_VEHICLEDISPATCHDETAIL info in lst[0].T_OA_VEHICLEDISPATCHDETAIL.ToList())
                    //foreach (T_OA_VEHICLEDISPATCHDETAIL info in lst[0].tToList())
                    {
                        T_OA_VEHICLEDISPATCHRECORD r = new T_OA_VEHICLEDISPATCHRECORD();
                        r.T_OA_VEHICLEDISPATCHDETAIL = info;
                        r.T_OA_VEHICLEDISPATCHDETAIL.T_OA_VEHICLEDISPATCH = info.T_OA_VEHICLEDISPATCH;

                        r.T_OA_VEHICLEDISPATCHDETAIL.VEHICLEDISPATCHDETAILID = info.VEHICLEDISPATCHDETAILID;
                        r.T_OA_VEHICLEDISPATCHDETAIL.T_OA_VEHICLEDISPATCH.VEHICLEDISPATCHID = info.T_OA_VEHICLEDISPATCH.VEHICLEDISPATCHID;
                        r.T_OA_VEHICLEDISPATCHDETAIL.T_OA_VEHICLEDISPATCH.DRIVER = info.T_OA_VEHICLEDISPATCH.DRIVER;
                        r.T_OA_VEHICLEDISPATCHDETAIL.T_OA_VEHICLEDISPATCH.T_OA_VEHICLE = frmD._lstVDispatch[0].T_OA_VEHICLE;

                        r.STARTTIME = info.T_OA_VEHICLEDISPATCH.STARTTIME;
                        r.ENDTIME = info.T_OA_VEHICLEDISPATCH.ENDTIME;
                        r.NUM = info.T_OA_VEHICLEDISPATCH.NUM;
                        r.ROUTE = info.T_OA_VEHICLEDISPATCH.ROUTE;
                        r.TEL = info.T_OA_VEHICLEDISPATCH.TEL;

                        r.FUEL = decimal.Parse("0.00");
                        r.RANGE = "0.00";
                        r.CONTENT = "";
                        //r.ISCHARGE = ckbHasFee.IsChecked == true ? "1" : "0";
                        //r.CHARGEMONEY = txtFee.Text == "" ? decimal.Parse("0.00") : decimal.Parse(txtFee.Text);

                        r.CREATECOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                        r.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                        r.CREATEUSERID = Common.CurrentLoginUserInfo.EmployeeID;
                        r.CREATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName;
                        r.CREATEPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                        r.CREATEDATE = DateTime.Now;

                        r.OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                        r.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                        r.OWNERID = Common.CurrentLoginUserInfo.EmployeeID;
                        r.OWNERNAME = Common.CurrentLoginUserInfo.EmployeeName;
                        r.OWNERPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID;

                        r.CHECKSTATE = "0";
                        _lstVRecord.Add(r);
                    }
                    if (_lstVRecord.Count > 0)
                    {
                        dg.ItemsSource = _lstVRecord;
                        dg.SelectedIndex = 0;

                        RdoSelect(_lstVRecord[0]);
                    }
                }
            }
            catch (Exception ex)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.ToString());
            }
        }
Beispiel #12
0
        private ObservableCollection<T_OA_VEHICLEDISPATCHRECORD> deletedList = new ObservableCollection<T_OA_VEHICLEDISPATCHRECORD>();//标记被删除的对象

        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            ObservableCollection<T_OA_VEHICLEDISPATCHRECORD> selectItems = GetSelectList();
            ObservableCollection<string> o = new ObservableCollection<string>();
            if (selectItems != null)
            {
                for (int i = 0; i < dg.SelectedItems.Count; i++)
                {
                    vehicledispatchrecord = selectItems[i];
                    if (vehicledispatchrecord.CHECKSTATE == ((int)CheckStates.UnSubmit).ToString())
                    {
                        string Result = "";
                        ComfirmWindow com = new ComfirmWindow();
                        com.OnSelectionBoxClosed += (obj, result) =>
                        {
                            try
                            {
                                foreach (T_OA_VEHICLEDISPATCHRECORD info in selectItems)
                                    o.Add(info.VEHICLEDISPATCHRECORDID);
                                vehicleDispatchManager.Del_VDRecordAsync(o);
                            }
                            catch
                            {

                            }
                        };
                        com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
                    }
                    else
                    {
                        Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTONLYDIDNOSUBMITANDREVIEWTHEDATACANBEDELETEDBY"));
                        return;
                    }
                }
            }
            else
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON"));
            }
        }