Exemplo n.º 1
0
 private void Init()
 {
     个税起征点   = PsHelper.GetPersonTaxPoint(期间_开始);
     标准职级工资表 = StepPayRate.GetEffectives(期间_开始);
     个人职级工资表 = PersonPayRate.GetEffectives(期间_开始);
     表工资表    = SalaryResult.GetSalaryResults(薪资组, 日历组);
     其它奖扣项   = OtherMoney.GetOtherMoneyList(年, 月);
     工资系数表   = EmpPayRate.GetEmpPayRateList(年, 月);
 }
Exemplo n.º 2
0
        protected void LoadData()
        {
            currRows = OtherMoney.GetOtherMoneyList(Convert.ToInt32(year.Value), Convert.ToInt32(month.Text));
            currRows = currRows.FindAll(a => a.类型 == type);
            //根据权限过滤
            currRows = currRows.FindAll(a => a.员工信息 != null && AccessController.CheckPayGroup(a.员工信息.薪资组));
            currRows = currRows.OrderBy(a => a.员工信息.创建时间).ToList();

            gridControl1.DataSource = currRows;
            gridControl1.RefreshDataSource();
        }
Exemplo n.º 3
0
        private void btn删除_Click(object sender, EventArgs e)
        {
            ColumnView colView = (ColumnView)gridControl1.MainView;

            if (colView != null)
            {
                if (MessageBox.Show("确实删除当前记录吗?", "删除提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2, 0, false) == DialogResult.Yes)
                {
                    OtherMoney currentItem = (OtherMoney)colView.GetFocusedRow();
                    currRows.Remove(currentItem);
                    currentItem.Delete();
                    gridControl1.RefreshDataSource();
                    MessageBox.Show("删除成功。", "删除提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Exemplo n.º 4
0
        private void btn保存_Click(object sender, EventArgs e)
        {
            ColumnView colView = (ColumnView)gridControl1.MainView;

            if (colView != null)
            {
                for (int i = 0; i < colView.RowCount; i++)
                {
                    OtherMoney currentItem = colView.GetRow(i) as OtherMoney;
                    if (currentItem != null)
                    {
                        currentItem.Save();
                    }
                }
                MessageBox.Show("保存成功!");
                LoadData();
            }
        }
Exemplo n.º 5
0
        private void btn保存_Click(object sender, EventArgs e)
        {
            CreateWaitDialog("正在保存导入的奖扣项数据...", "请稍等");

            foreach (OtherMoneyData row in currRows)
            {
                OtherMoney newItem = OtherMoney.AddOtherMoney(row.员工编号, row.姓名, row.年, row.月, row.类型, row.项目名称);
                newItem.金额   = row.金额;
                newItem.录入人  = AccessController.CurrentUser.姓名;
                newItem.录入时间 = DateTime.Now;
                newItem.Save();
            }

            CloseWaitDialog();

            MyHelper.WriteLog(LogType.信息, "导入其他奖项和扣项", null);

            MessageBox.Show("保存成功!");
        }
Exemplo n.º 6
0
        private void gridView1_CellValueChanged(object sender, CellValueChangedEventArgs e)
        {
            OtherMoney row = gridView1.GetRow(e.RowHandle) as OtherMoney;

            if (row != null)
            {
                if (e.Column.FieldName == "员工编号")
                {
                    PersonalInfo pInfo = PersonalInfo.Get(row.员工编号);
                    if (pInfo == null)
                    {
                        MessageBox.Show("找不到指定编号的员工");
                    }
                    else
                    {
                        row.姓名 = pInfo.姓名;
                        gridControl1.RefreshDataSource();
                    }
                }
            }
        }
Exemplo n.º 7
0
        private void OnEmployeeSelectd(object sender, EmployeeInfo emp)
        {
            OtherMoney item = new OtherMoney();

            item.类型  = type;
            item.年   = Convert.ToInt32(year.Value);
            item.月   = Convert.ToInt32(month.Text);
            item.录入人 = AccessController.CurrentUser.姓名;

            item.员工编号 = emp.员工编号;
            item.姓名   = emp.姓名;
            try
            {
                item.Save();
                currRows.Add(item);
                gridControl1.RefreshDataSource();
                gridView1.FocusedRowHandle = gridView1.RowCount - 1;
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }