Esempio n. 1
0
        void DtGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            DataGrid grid = sender as DataGrid;

            if (grid.SelectedItem != null)
            {
                SelectID = grid.SelectedItems[0] as T_HR_EMPLOYEESALARYRECORD;
            }
        }
Esempio n. 2
0
        public T_HR_EMPLOYEESALARYRECORD GetSalaryRecord(string employeeID, string year, string month)                              //必须是为审核的
        {
            var ents = from a in dal.GetObjects <T_HR_EMPLOYEESALARYRECORD>()
                       where a.EMPLOYEEID == employeeID && a.SALARYMONTH == month && a.SALARYYEAR == year && a.CHECKSTATE == "2"
                       select a;
            T_HR_EMPLOYEESALARYRECORD record = ents.Count() > 0 ? ents.FirstOrDefault() : null;

            return(record);
        }
Esempio n. 3
0
        void DtGrid_LoadingRowDetails(object sender, DataGridRowDetailsEventArgs e)
        {
            DataGrid gridDetails         = e.DetailsElement as DataGrid;
            T_HR_EMPLOYEESALARYRECORD sr = e.Row.DataContext as T_HR_EMPLOYEESALARYRECORD;

            if (sr.EMPLOYEEID != string.Empty && sr.SALARYYEAR != string.Empty && sr.SALARYMONTH != string.Empty)
            {
                string months = sr.SALARYMONTH;
                string years  = sr.SALARYYEAR;
                if (sr.SALARYMONTH == "1")
                {
                    years  = (Convert.ToInt32(years) - 1).ToString();
                    months = "12";
                }
                else
                {
                    months = (Convert.ToInt32(months) - 1).ToString();
                }
                SalaryServiceClient clienttemp = new SalaryServiceClient();
                clienttemp.GetSalaryRecordOneCompleted += (o, ev) =>
                {
                    if (ev.Error == null)
                    {
                        if (ev.Result != null)
                        {
                            List <T_HR_EMPLOYEESALARYRECORD> salaryrecordlast = new List <T_HR_EMPLOYEESALARYRECORD>();
                            salaryrecordlast.Add(ev.Result);
                            gridDetails.ItemsSource = salaryrecordlast;
                            gridDetails.Visibility  = Visibility.Visible;
                        }
                        else
                        {
                            gridDetails.Visibility = Visibility.Collapsed;
                        }
                    }
                    else
                    {
                        ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"),
                                                       Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                        //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ev.Error.Message));
                    }
                };
                clienttemp.GetSalaryRecordOneAsync(sr.EMPLOYEEID, years, months);
            }
            else
            {
                gridDetails.Visibility = Visibility.Collapsed;
            }
        }
Esempio n. 4
0
        public EmployeeSalaryRecordForm(FormTypes type, string employeesalaryrecordID)
        {
            InitializeComponent();
            InitParas();
            FormType = type;
            if (string.IsNullOrEmpty(employeesalaryrecordID))
            {
                SalaryRecord = new T_HR_EMPLOYEESALARYRECORD();
                SalaryRecord.EMPLOYEESALARYRECORDID = Guid.NewGuid().ToString();
                SalaryRecord.CREATEUSERID           = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                SalaryRecord.CREATEDATE             = System.DateTime.Now;

                //SalaryRecord.UPDATEDATE = System.DateTime.Now;
                SalaryRecord.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;

                this.DataContext = SalaryRecord;
            }
            else
            {
                NotShow(type);
                client.GetEmployeeSalaryRecordByIDAsync(employeesalaryrecordID);
            }
        }
Esempio n. 5
0
        void _ImgButtonSalaryPaidConfirm_Click(object sender, RoutedEventArgs e)
        {
            string Result = "";

            if (DtGriddy == null || DtGriddy.ItemsSource == null)
            {
                return;
            }
            ObservableCollection <T_HR_EMPLOYEESALARYRECORD> temp = new ObservableCollection <T_HR_EMPLOYEESALARYRECORD>();

            foreach (object v in DtGriddy.ItemsSource)
            {
                T_HR_EMPLOYEESALARYRECORD ent = v as T_HR_EMPLOYEESALARYRECORD;
                CheckBox cb = DtGriddy.Columns[1].GetCellContent(v).FindName("CheckBoxs") as CheckBox;
                if (cb.IsChecked == true)
                {
                    ent.PAYCONFIRM = "2";
                    ent.PAIDDATE   = System.DateTime.Now;
                    ent.PAIDBY     = "Adminstrator";
                    temp.Add(ent);
                }
            }
            if (temp.Count > 0)
            {
                ComfirmWindow com = new ComfirmWindow();
                com.OnSelectionBoxClosed += (obj, result) =>
                {
                    client.PaymentConfirmUpdateAsync(temp);
                    loadbar.Start();
                };
                com.SelectionBox(Utility.GetResourceStr("CONFIRM"), Utility.GetResourceStr("PAYALTER"), ComfirmWindow.titlename, Result);
            }
            else
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTDATAALERT"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
            }
        }
Esempio n. 6
0
        public EmployeeSalaryRecordForm(FormTypes type, string employeesalaryrecordID)
        {

            InitializeComponent();
            InitParas();
            FormType = type;
            if (string.IsNullOrEmpty(employeesalaryrecordID))
            {
                SalaryRecord = new T_HR_EMPLOYEESALARYRECORD();
                SalaryRecord.EMPLOYEESALARYRECORDID = Guid.NewGuid().ToString();
                SalaryRecord.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                SalaryRecord.CREATEDATE = System.DateTime.Now;

                //SalaryRecord.UPDATEDATE = System.DateTime.Now;
                SalaryRecord.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;

                this.DataContext = SalaryRecord;
            }
            else
            {
                NotShow(type);
                client.GetEmployeeSalaryRecordByIDAsync(employeesalaryrecordID);
            }
        }
Esempio n. 7
0
 public void EmployeeSalaryRecordUpdate(T_HR_EMPLOYEESALARYRECORD entity)
 {
     using (EmployeeSalaryRecordBLL bll = new EmployeeSalaryRecordBLL())
     {
         bll.EmployeeSalaryRecordUpdate(entity);
     }
 }
Esempio n. 8
0
 public void PaymentUpdate(T_HR_EMPLOYEESALARYRECORD entity)
 {
     using (PaymentBLL bll = new PaymentBLL())
     {
         bll.PaymentUpdate(entity);
     }
 }
Esempio n. 9
0
 void DtGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     DataGrid grid = sender as DataGrid;
     if (grid.SelectedItem != null)
     {
         SelectID = grid.SelectedItems[0] as T_HR_EMPLOYEESALARYRECORD;
     }
 }
Esempio n. 10
0
        public decimal GenerateEmployeeRecord(string employeeID, string year, string month)
        {
            decimal total = 0;
            var     ents  = from a in dal.GetObjects <T_HR_CUSTOMGUERDONARCHIVE>()
                            join b in dal.GetObjects <T_HR_CUSTOMGUERDONSET>() on a.CUSTOMERGUERDONID equals b.CUSTOMGUERDONSETID
                            join c in dal.GetObjects <T_HR_SALARYARCHIVE>() on a.T_HR_SALARYARCHIVE.SALARYARCHIVEID equals c.SALARYARCHIVEID
                            where a.T_HR_SALARYARCHIVE.EMPLOYEEID == employeeID
                            select new
            {
                GENERATETYPE      = b.CALCULATORTYPE,
                SUM               = a.SUM,
                CHECKSTATE        = a.T_HR_SALARYARCHIVE.CHECKSTATE,
                EMPLOYEEID        = a.T_HR_SALARYARCHIVE.EMPLOYEEID,
                EMPLOYEECODE      = a.T_HR_SALARYARCHIVE.EMPLOYEECODE,
                EMPLOYEENAME      = a.T_HR_SALARYARCHIVE.EMPLOYEENAME,
                GUERDONNAME       = b.GUERDONNAME,
                CUSTOMERGUERDONID = b.CUSTOMGUERDONSETID,
                GUERDONCATEGORY   = b.GUERDONCATEGORY,
                REMARK            = c.REMARK
            };

            T_HR_EMPLOYEESALARYRECORD esrecord = GetSalaryRecord(employeeID, year, month);

            List <T_HR_CUSTOMGUERDONRECORD> recordlist = GetEmployeeCustomRecord(employeeID, year, month);

            nsize = GetAccuracy(employeeID);
            if (recordlist.Count() > 0)                                                            //已经有至少一个自定义记录存在
            {
                CustomGuerdonRecordDelete(employeeID, year, month);
            }
            foreach (var en in ents)
            {
                T_HR_CUSTOMGUERDONRECORD cgrecord = new T_HR_CUSTOMGUERDONRECORD();
                cgrecord.CUSTOMGUERDONRECORDID = Guid.NewGuid().ToString();
                cgrecord.EMPLOYEEID            = employeeID;
                cgrecord.GENERATETYPE          = en.GENERATETYPE;
                cgrecord.SALARYSUM             = en.SUM;
                cgrecord.CHECKSTATE            = en.CHECKSTATE;
                cgrecord.EMPLOYEEID            = en.EMPLOYEEID;
                cgrecord.EMPLOYEECODE          = en.EMPLOYEECODE;
                cgrecord.EMPLOYEENAME          = en.EMPLOYEENAME;
                cgrecord.GUERDONNAME           = en.GUERDONNAME;
                cgrecord.CUSTOMERGUERDONID     = en.CUSTOMERGUERDONID;
                cgrecord.REMARK      = en.REMARK;
                cgrecord.SALARYMONTH = month;
                cgrecord.SALARYYEAR  = year;
                cgrecord.CREATEDATE  = System.DateTime.Now;
                try
                {
                    cgrecord.CREATEUSERID       = construe[0];
                    cgrecord.CREATEPOSTID       = construe[1];
                    cgrecord.CREATEDEPARTMENTID = construe[2];
                    cgrecord.CREATECOMPANYID    = construe[3];

                    cgrecord.OWNERID           = construe[4];
                    cgrecord.OWNERPOSTID       = construe[5];
                    cgrecord.OWNERDEPARTMENTID = construe[6];
                    cgrecord.OWNERCOMPANYID    = construe[7];
                }
                catch (Exception exx)
                {
                    exx.Message.ToString();
                }

                if (en.GUERDONCATEGORY == "1")                                          //1是加2是减
                {
                    total += Convert.ToDecimal(en.SUM);
                }
                else
                {
                    total -= Convert.ToDecimal(en.SUM);
                    cgrecord.SALARYSUM = -en.SUM;
                }
                if (IsComputer)
                {
                    dal.Add(cgrecord);
                }
            }

            if (esrecord != null)
            {
                decimal?temp = esrecord.CUSTOMERSUM;
                esrecord.CUSTOMERSUM  = Math.Round(total, nsize);
                esrecord.ACTUALLYPAY += Math.Round(Convert.ToDecimal(total - temp), nsize);
                //esrecord.PERSONALINCOMETAX = 更新个税
                esrecord.SUBTOTAL += Math.Round(Convert.ToDecimal(total - temp), nsize);
                if (IsComputer)
                {
                    new EmployeeSalaryRecordBLL().Update(esrecord);
                }
            }
            return(total);
        }