コード例 #1
0
        private void btnPostedVoucher_Click(object sender, EventArgs e)
        {
            if (RefNo == "" || RefNo == null)
            {
                XtraMessageBox.Show("Không tồn tại chứng từ để ghi sổ",
                                    ResourceHelper.GetResourceValueByName("ResDetailContent"),
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (_lockPresenter.CheckLockDate(-1, 600, DateTime.Parse(_dbOptionHelper.PostedDate)))
            {
                XtraMessageBox.Show("Bạn đang ghi sổ trong ngày đã khóa. Bạn phải bỏ khóa sổ!.", "Thông báo",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            salaryVouchersPresenter.Save(PostedDate.ToShortDateString(), RefNo, RefTypeId);
            //Reload lai  cac grid
            RefNo = "";
            salaryVouchersPresenter.Display(PostedDate.ToShortDateString());
            if (gridViewSalaryVoucher.RowCount > 0)
            {
                RefNo = gridViewSalaryVoucher.GetRowCellValue(0, "RefNo").ToString();
                employeesPresenter.DisplayByMonthDateAndRefNo(PostedDate.ToShortDateString(), RefNo);
            }
            employeesPresenter.DisplayByMonthDateAndRefNo(PostedDate.ToShortDateString(), RefNo);

            if (RefNo == "" || RefNo == null)
            {
                btnPostedVoucher.Enabled = false;
                btnCancelCalc.Enabled    = false;
            }
        }
コード例 #2
0
        private void btnCancelCalc_Click(object sender, EventArgs e)
        {
            //if (_lockPresenter.CheckLockDate(-1, 600, DateTime.Parse(PostedDate)))
            //{
            //    XtraMessageBox.Show("Bạn không được hủy tính lương khi đã khóa sổ. Bạn phải bỏ khóa sổ!.", "Thông báo",
            //          MessageBoxButtons.OK, MessageBoxIcon.Warning);
            //    return;
            //}

            salaryVouchersPresenter.CancelCalc(PostedDate.ToShortDateString(), RefNo, RefTypeId);

            RefNo = "";
            salaryVouchersPresenter.Display(PostedDate.ToShortDateString());
            if (gridViewSalaryVoucher.RowCount > 0)
            {
                RefNo = gridViewSalaryVoucher.GetRowCellValue(0, "RefNo").ToString();
                employeesPresenter.DisplayByMonthDateAndRefNo(PostedDate.ToShortDateString(), RefNo);
            }
            employeesPresenter.DisplayByMonthDateAndRefNo(PostedDate.ToShortDateString(), RefNo);

            if (RefNo == "" || RefNo == null)
            {
                btnPostedVoucher.Enabled = false;
                btnCancelCalc.Enabled    = false;
            }
        }
コード例 #3
0
        public override string ToString()
        {
            var sb = new StringBuilder();

            sb.AppendLine();
            sb.AppendLine($"Job Id: {JobId}");
            sb.AppendLine($"Job Type: {JobType}");
            sb.AppendLine($"Job Description: {JobDescription}");
            sb.AppendLine($"Posting Date: {PostedDate.ToLongDateString()}");

            return(sb.ToString());
        }
コード例 #4
0
 public override string ToString()
 => String.Format
 (
     "Title: {0} Slug {1} Tags {2} Author {3} PostedDate {4} Image Path {5} Image Credit {6}",
     Title,
     Slug,
     String.Join(", ", Tags.Select(t => t.Value)),
     Author,
     PostedDate.ToString("yyyy-MM-dd"),
     Image.Url,
     Image.Credit
 )
 ;
コード例 #5
0
 private void FrmXtraSalaryVoucher_Load(object sender, EventArgs e)
 {
     salaryVouchersPresenter.DisplayPostedDate(PostedDate.ToShortDateString());
     if (((List <SalaryVoucherModel>)gridSalaryVoucher.DataSource).Count > 0)
     {
         RefNo = ((List <SalaryVoucherModel>)gridSalaryVoucher.DataSource)[0].RefNo;
         employeesPresenter.DisplayByMonthDateAndRefNo(PostedDate.ToShortDateString(), RefNo);
     }
     if (RefNo == "" || RefNo == null)
     {
         btnCancelSalary.Enabled = false;
         btnShowVoucher.Enabled  = false;
     }
 }
コード例 #6
0
        private void FrmXtraSalaryPostedVoucher_Load(object sender, EventArgs e)
        {
            salaryVouchersPresenter.Display(PostedDate.ToShortDateString());
            if (gridViewSalaryVoucher.RowCount > 0)
            {
                RefNo = gridViewSalaryVoucher.GetRowCellValue(0, "RefNo").ToString();
                employeesPresenter.DisplayByMonthDateAndRefNo(PostedDate.ToShortDateString(), RefNo);
            }

            if (RefNo == "" || RefNo == null)
            {
                btnPostedVoucher.Enabled = false;
                btnCancelCalc.Enabled    = false;
            }
        }
コード例 #7
0
        private void btnCancelSalary_Click(object sender, EventArgs e)
        {
            if (RefNo == "" || RefNo == null)
            {
                XtraMessageBox.Show(@"Không còn chừng từ để hủy tính",
                                    ResourceHelper.GetResourceValueByName("ResDetailContent"),
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            //string[] separators = { "/" };
            //string[] words = PostedDate.Split(separators, StringSplitOptions.RemoveEmptyEntries);
            //if (_lockPresenter.CheckLockDate(-1, 600, DateTime.Parse(words[1] + "/" + words[0] + "/" + words[2])))
            if (_lockPresenter.CheckLockDate(-1, 600, PostedDate))
            {
                XtraMessageBox.Show(@"Bạn không thể hủy chứng từ lương trong ngày khóa sổ. Bạn phải bỏ khóa sổ",
                                    ResourceHelper.GetResourceValueByName("ResDetailContent"),
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }


            salaryVouchersPresenter.SaveCancel(PostedDate.ToShortDateString(), RefNo, RefTypeId);//Hủy tính lương
            //Reload lai  cac grid
            RefNo = "";
            salaryVouchersPresenter.DisplayPostedDate(PostedDate.ToShortDateString());
            if (((List <SalaryVoucherModel>)gridSalaryVoucher.DataSource).Count > 0)
            {
                RefNo = ((List <SalaryVoucherModel>)gridSalaryVoucher.DataSource)[0].RefNo;
            }
            else
            {
                btnCancelSalary.Enabled = false;
                btnShowVoucher.Enabled  = false;
            }
            employeesPresenter.DisplayByMonthDateAndRefNo(PostedDate.ToShortDateString(), RefNo);
        }
コード例 #8
0
 /// <summary>
 ///  Returns the PostDate as a string, using a standard format
 /// </summary>
 /// <returns>String</returns>
 public string GetPostedDateAsString() => PostedDate.ToString("yyyy-MM-dd");
コード例 #9
0
 private void gridViewSalaryVoucher_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
 {
     RefNo = gridViewSalaryVoucher.GetRowCellValue(gridViewSalaryVoucher.FocusedRowHandle, "RefNo").ToString();
     employeesPresenter.DisplayByMonthDateAndRefNo(PostedDate.ToShortDateString(), RefNo);
 }