From b26ae60e85d4a03a2426e6607e7afe89e1c10a5f Mon Sep 17 00:00:00 2001
From: duheng <2784771470@qq.com>
Date: 星期四, 05 十二月 2024 11:50:35 +0800
Subject: [PATCH] 水池单独匹配界面修改

---
 WinFrmUI/HStation.WinFrmUI.Organize.Core/00-UserControl/EmloyeeInfoCtrl.cs |  118 ++++++++++++++++++++++-------------------------------------
 1 files changed, 44 insertions(+), 74 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.Organize.Core/00-UserControl/EmloyeeInfoCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Organize.Core/00-UserControl/EmloyeeInfoCtrl.cs
index 982bda2..5badcc5 100644
--- a/WinFrmUI/HStation.WinFrmUI.Organize.Core/00-UserControl/EmloyeeInfoCtrl.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Organize.Core/00-UserControl/EmloyeeInfoCtrl.cs
@@ -22,22 +22,22 @@
         int staffstatus;
         public void ShowBangDingData(HStation.Vmo.EmployeeMain employee)//灞曠ず鏈帶浠舵暟鎹�
         {
+            //HStation.WinFrmUI.Organize.EmployeeViewModel _employee = new HStation.WinFrmUI.Organize.EmployeeViewModel(employee);
             NametextEdit.Text = employee.FirstName;//濮撳悕
             textEditBianHao.Text = employee.ErpCode;//缂栧彿
             ZhiWutextEdit.Text = employee.PositonName;//鑱屽姟
             DianHuatextEdit.Text = employee.Telephone;//鐢佃瘽
             textEditQianMing.Text = employee.DrawSignal;//绛惧悕
             YouXiangtextEdit.Text = employee.Email;//閭 
-            ChongZhiimageComboBoxEdit.SelectedIndex = employee.RequirePasswordReset;//閲嶇疆瀵嗙爜
-            if (employee.StaffStatus.ToString() == "鍦ㄨ亴")
+            ChongZhiimageComboBoxEdit.SelectedIndex = employee.RequirePasswordReset;
+            if (employee.StaffStatus == Vmo.eJobType.exist)
             {
-                 staffstatus = 1;
+                ZhuangTaiimageComboBoxEdit.SelectedIndex = 1;
             }
             else
             {
-                 staffstatus = 0;
+                ZhuangTaiimageComboBoxEdit.SelectedIndex = 0;
             }
-            ZhuangTaiimageComboBoxEdit.SelectedIndex = staffstatus;//鍦ㄨ亴鐘舵��
             EnglishNametextEdit.Text = employee.LastName;//濮撳悕 鑻辨枃
         }
 
@@ -45,6 +45,7 @@
         {
             error = "";
             HStation.Vmo.EmployeeMain employee = new Vmo.EmployeeMain();
+            employee = _employee;
             dxValidationProviderBianHao.Validate();
             if (String.IsNullOrEmpty(NametextEdit.Text) || String.IsNullOrEmpty(textEditBianHao.Text) )
             {
@@ -73,6 +74,7 @@
                 error = "璇疯緭鍏ユ纭殑閭锛�";
                 return null;
             }
+            employee.LastModifyTime = DateTime.Now.ToString();
             employee.FirstName = NametextEdit.Text;
             employee.ErpCode = textEditBianHao.Text;
             employee.PositonName = ZhiWutextEdit.Text;
@@ -80,7 +82,13 @@
             employee.DrawSignal = textEditQianMing.Text;
             employee.Email = YouXiangtextEdit.Text;
             employee.RequirePasswordReset = ChongZhiimageComboBoxEdit.SelectedIndex;
-            employee.StaffStatus = Vmo.eJobType.exist;
+            if (ZhuangTaiimageComboBoxEdit.SelectedIndex == 1)
+            {
+                employee.StaffStatus = Vmo.eJobType.exist;
+            }else
+            {
+                employee.StaffStatus = Vmo.eJobType.leave;
+            }
             employee.LastName = EnglishNametextEdit.Text;
             return employee;
         }
@@ -92,36 +100,12 @@
             error = "";
             
             this._employee = employee;
-            if (_employee.ErpCode == null)//娣诲姞
+            if (_employee.EmployeeID == 0)
             {
                 //_employee.AddTime = DateTime.Now;
                 //_employee.LastModifyTime = DateTime.Now.ToString();
                 _employee = ReadCtrlData(out error);
-                if (_employee == null)//鍑虹幇閿欒骞惰繑鍥瀗ull鍜岄敊璇�
-                {
-                    return null;
-                }
-                if (!string.IsNullOrEmpty(error))
-                {
-                    return null;
-                }
-                if (!checkEditCreateLogin.Checked) //娌℃湁閫変腑鍒涘缓鐢ㄦ埛
-                {
-                    //loginUserInfoCtrl.SetNoInput();//loginUserInfoCtrl鎺т欢涓嶅彲缂栬緫
-                    return _employee;
-                }
-                //loginUserInfoCtrl.SetOffInput();//loginUserInfoCtrl鎺т欢鍙紪杈�
-                if (loginUserInfoCtrl.NewBindingData(_employee.LoginAccount, out error) == null)//鍑虹幇閿欒骞惰繑鍥瀗ull鍜岄敊璇�
-                {
-                    return null;
-                }
-                return _employee;
-            }
-            else//淇敼
-            {
-
-                //_employee.LastModifyTime = DateTime.Now.ToString();
-                _employee = ReadCtrlData(out error);
+                employee.AddTime = DateTime.Now;
                 if (!string.IsNullOrEmpty(error))
                 {
                     return null;
@@ -132,13 +116,39 @@
                 }
                 else
                 {
-                    if (loginUserInfoCtrl.NewBindingData(_employee.LoginAccount, out error) != null)//鍑虹幇閿欒骞惰繑鍥瀗ull鍜岄敊璇�
+                    if (loginUserInfoCtrl.NewBindingData(_employee.User, out error) == null)//鍑虹幇閿欒骞惰繑鍥瀗ull鍜岄敊璇�
                     {
                         return null;
                     }
                 }
                 return _employee;
             }
+            else
+            {
+                _employee = ReadCtrlData(out error);
+                if (_employee.EmployeeID == 0)//鍑虹幇閿欒骞惰繑鍥瀗ull鍜岄敊璇�
+                {
+                    error = "鍑虹幇閿欒锛両D涓�0!";
+                    return null;
+                }
+                if (!string.IsNullOrEmpty(error))
+                {
+                    return null;
+                }
+                if (!checkEditCreateLogin.Checked)//鍒ゆ柇鏄惁鏂板缓鐢ㄦ埛
+                {
+                    return _employee;
+                }
+                else
+                {
+                    if (loginUserInfoCtrl.NewBindingData(_employee.User, out error) == null)//鍑虹幇閿欒骞惰繑鍥瀗ull鍜岄敊璇�
+                    {
+                        return null;
+                    }
+                }
+                return _employee;
+            }
+           
 
 
         }
@@ -153,19 +163,11 @@
                 return;
             }
             ShowBangDingData(employee);
-            if (employee.LoginAccount != null)
+            if (employee.User != null)
             {
                 loginUserInfoCtrl.SetNoInput();
                 checkEditCreateLogin.Visible = false;
             }
-            //if (!checkEditCreateLogin.Checked)//鍒ゆ柇璇ユ帶浠舵槸鍚﹀彲缂栬緫
-            //{
-            //    loginUserInfoCtrl.SetNoInput();
-            //}
-            //else
-            //{
-            //    loginUserInfoCtrl.SetOffInput();
-            //}
         }
 
 
@@ -180,38 +182,6 @@
             }
             ShowBangDingData(employee);
         }
-
-        //public HStation.Vmo.EmployeeMain GetBindingData(out string error)
-        //{
-        //    if (this._employee == null)
-        //    {
-        //        error = "鍏ュ弬涓虹┖";
-        //        return null;
-        //    }
-
-        //    _employee.FirstName = NametextEdit.Text;
-        //    _employee.ErpCode = textEditBianHao.Text;
-        //    _employee.PositonName = ZhiWutextEdit.Text;
-        //    _employee.Telephone = DianHuatextEdit.Text;
-        //    _employee.DrawSignal = textEditQianMing.Text;
-        //    _employee.Email = YouXiangtextEdit.Text;
-        //    _employee.RequirePasswordReset = ChongZhiimageComboBoxEdit.SelectedIndex;
-        //    _employee.StaffStatus = ZhuangTaiimageComboBoxEdit.SelectedIndex;
-        //    _employee.LastName = EnglishNametextEdit.Text;
-
-        //    if (!dxValidationProviderBianHao.Validate())
-        //    {
-        //        error = "wei......";
-        //        return null;
-        //    }
-
-        //    error = "ing....";
-        //    return _employee;
-        //}
-
-
-
-
 
         private void TouXiangpictureEdit_Click(object sender, EventArgs e)
         {

--
Gitblit v1.9.3