Exemplo n.º 1
0
 private void _sbSave_Click(object sender, EventArgs e)
 {
     if (Save())
     {
         _id = 0;
         for (int i = 0; i < panel1.Controls.Count; i++)
         {
             try
             {
                 BaseContranl.LabAndText lt = panel1.Controls[i] as BaseContranl.LabAndText;
                 lt.EditVal = string.Empty;
             }
             catch { }
             try
             {
                 BaseContranl.LabAndLookupEdit ll = panel1.Controls[i] as BaseContranl.LabAndLookupEdit;
                 ll.editVal = 0;
             }
             catch { }
         }
         string sn = BasicClass.GetDataSet.GetOne(BasicClass.Bllstr.bllMiniEmp, "GetMaxSn", null).ToString();
         try
         {
             _ltSn.val = (int.Parse(sn) + 1).ToString();
         }
         catch { }
         ucCheckComboBox1.Values = string.Empty;
         ucCheckComboBox2.Values = string.Empty;
         _teRoyalty.EditValue    = mod.Royalty = 0;
         _teLastMoney.EditValue  = mod.LassMoney = 0;
         _teNeedDeposit.EditVal  = mod.NeedDeposit = 0;
         _teDeposit.EditVal      = mod.Deposit = 0;
         _teLastMoney.Visible    = _teRoyalty.Visible = lookUpEdit1.Visible = false;
     }
 }
Exemplo n.º 2
0
 private void frEmployeeForms_Load(object sender, EventArgs e)
 {
     dtWT = BasicClass.GetDataSet.GetDS(BasicClass.Bllstr.bllWorkType, "GetAllList", null).Tables[0];
     ucCheckComboBox2.DataDt        = ucCheckComboBox1.DataDt = dtWT;
     ucCheckComboBox2.DisplayMember = ucCheckComboBox1.DisplayMember = "Name";
     ucCheckComboBox2.ValueMember   = ucCheckComboBox1.ValueMember = "ID";
     _sbSave.Enabled = (_operation != (int)BasicClass.Enums.Operation.View);
     //   dtPro = BasicClass.GetDataSet.GetDS(BasicClass.Bllstr.bllChinaZone, "GetList", new object[] { "(OrderNum=2)" }).Tables[0];
     //   dtCity = BasicClass.GetDataSet.GetDS(BasicClass.Bllstr.bllChinaZone, "GetList", new object[] { "(OrderNum=3)" }).Tables[0];
     //    dtCou = BasicClass.GetDataSet.GetDS(BasicClass.Bllstr.bllChinaZone, "GetList", new object[] { "(OrderNum=4)" }).Tables[0];
     SetLab();
     //MyPrintDocument.PrinterSettings.PrinterName = "Zebra  LP2443";
     //MyPrintDocument.DefaultPageSettings.Landscape = false;
     _teBoardWages.EditValue = 0;
     //   dt = dtOld.Clone();
     if (_id > 0)
     {
         dt = BasicClass.GetDataSet.GetDS(BasicClass.Bllstr.bllMiniEmp, "GetList", new object[] { "(ID=" + _id + ")" }).Tables[0];
         if (dt.Rows.Count > 0)
         {
             mod = bllEmp.DataTableToList(dt)[0];
         }
         _ltSn.val           = mod.Sn;
         _ltName.val         = mod.Name;
         _leJSR.editVal      = mod.IntroducerID;
         _ltIdentityCard.val = mod.IdentityCard;
         _reSex.EditValue    = mod.Sex;
         _leProvince.editVal = mod.Province;
         _leCity.editVal     = mod.City;
         _leCounty.editVal   = mod.County;
         _ltAddress.val      = mod.Address;
         _ltPhone.val        = mod.Phone;
         _ldAcc.val          = mod.AccDate;
         _lePayType.editVal  = mod.PayID;
         if (mod.DimDate == DateTime.Parse("1900-1-1"))
         {
             _ldDim.val = null;
         }
         else
         {
             _ldDim.val = mod.DimDate;
         }
         _leBed.editVal         = _bedID = mod.BedID;
         _leTable.editVal       = _tableID = mod.TableID;
         _leDepartment.editVal  = mod.DepartmentID;
         _leDegree.editVal      = mod.DegreeID;
         _lePolity.editVal      = mod.PolityID;
         _teSOSMan.EditValue    = mod.SOSMan;
         _teSOSPhone.EditValue  = mod.SOSPhone;
         _ltNowAddress.val      = mod.NowAddress;
         _teRoyalty.EditValue   = mod.Royalty;
         _teLastMoney.EditValue = mod.LassMoney;
         _picName = mod.Image;
         pictureEdit1.EditValue  = BasicClass.ZipJpg.ShowPic(mod.Image);
         _ltIDCard.val           = mod.IDCardID.ToString();
         ucCheckComboBox1.Values = mod.WorkTypeID;
         ucCheckComboBox2.Values = mod.DefaultWorkType;
         _teNeedDeposit.EditVal  = mod.NeedDeposit;
         _teDeposit.EditVal      = mod.Deposit;
         _teBoardWages.EditValue = mod.BoardWages;
         if (mod.HeTongDate.Year == 1 || mod.HeTongDate == DateTime.Parse("1900-1-1"))
         {
             _ldHeTongDate.val = null;
         }
         else
         {
             _ldHeTongDate.val = mod.HeTongDate;
         }
         _teHeTongAmount.EditVal = mod.HeTongAmount;
         if (mod.HeTongDQDate.Year == 1 || mod.HeTongDQDate == DateTime.Parse("1900-1-1"))
         {
             _ldHeTongDQDate.val = null;
         }
         else
         {
             _ldHeTongDQDate.val = mod.HeTongDQDate;
         }
         if (mod.PayID == 49 || mod.PayID == 50)
         {
             lookUpEdit1.EditValue = Convert.ToInt32(mod.LassMoney);
             lookUpEdit1.Visible   = true;
             _teLastMoney.Visible  = _teRoyalty.Visible = false;
         }
         else if (mod.PayID == 48)
         {
             lookUpEdit1.Visible  = false;
             _teLastMoney.Visible = true;
             _teRoyalty.Visible   = false;
         }
         else
         {
             lookUpEdit1.Visible  = false;
             _teLastMoney.Visible = _teRoyalty.Visible = false;
         }
         _ceIsCaicTiCheng.Checked  = mod.IsCaicTiCheng;
         _teMaxAmountDay.EditValue = mod.MaxAmountDay;
         // _teDeposit.IsCanEdit = (Convert.ToInt32(BasicClass.GetDataSet.GetOne(BasicClass.Bllstr.bllMiniEmp, "GetCaicPayCount", new object[] {_id })) == 0);
         if (mod.DimDate > Convert.ToDateTime("1900-1-1"))
         {
             _teDeposit.IsCanEdit = true;
         }
         _teBankAccountName.EditValue = mod.BankAccountName;
         _teBankName.EditValue        = mod.BankName;
         _teBankNO.EditValue          = mod.BankNO;
     }
     else
     {
         for (int i = 0; i < panel1.Controls.Count; i++)
         {
             try
             {
                 BaseContranl.LabAndText lt = panel1.Controls[i] as BaseContranl.LabAndText;
             }
             catch { }
             try
             {
                 BaseContranl.LabAndLookupEdit ll = panel1.Controls[i] as BaseContranl.LabAndLookupEdit;
             }
             catch { }
         }
         string sn = BasicClass.GetDataSet.GetOne(BasicClass.Bllstr.bllMiniEmp, "GetMaxSn", null).ToString();
         try
         {
             _ltSn.val = (int.Parse(sn) + 1).ToString();
         }
         catch { }
         _teRoyalty.EditValue         = mod.Royalty = 0;
         _teLastMoney.EditValue       = mod.LassMoney = 0;
         _teNeedDeposit.EditVal       = mod.NeedDeposit = 0;
         _teDeposit.EditVal           = mod.Deposit = 0;
         _teMaxAmountDay.EditValue    = mod.MaxAmountDay = 0;
         _teLastMoney.Visible         = _teRoyalty.Visible = lookUpEdit1.Visible = false;
         _teBankAccountName.EditValue = _teBankName.EditValue = _teBankNO.EditValue = string.Empty;
     }
     _ltName.Focus();
 }