コード例 #1
0
        private void dgrFee_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
        {
            try
            {
                string tem = "";
                if (e.EditingElement.ToString() != "")
                {
                    tem = ((System.Windows.Controls.TextBox)(e.EditingElement)).Text;
                }

                if (tem == "")
                {
                    c_ok = false;
                    DataGridHelper.NVSFocus(dgrFee, 0, 2);
                }

                tem = tem.Replace(",", "").Trim();

                if (!CheckValidate.CheckGiaDuong(tem))
                {
                    c_ok = false;
                    DataGridHelper.NVSFocus(dgrFee, 0, 2);
                }
                else
                {
                    c_ok = true;
                }
            }
            catch (Exception ex)
            {
                ErrorLog.log.Error(ex.ToString());
            }
        }
コード例 #2
0
        bool Check_validate_Fee_Extend()
        {
            try
            {
                if (c_lst_Fee_Extend.Count == 0)
                {
                    NoteBox.Show("Không có thông tin thanh toán phí gia hạn", "", NoteBoxLevel.Error);
                    tabExtend.Focus();
                    UpdateLayout();
                    txtFee_Extend.Focus();
                    return(false);
                }

                if (c_ok_Extend == false)
                {
                    NoteBox.Show("Số tiền 1 lần thanh toán gia hạn không đúng định dạng", "", NoteBoxLevel.Error);
                    tabExtend.Focus();
                    UpdateLayout();
                    dgrFee_Extend.Focus();
                    return(false);
                }

                for (int i = 0; i < c_lst_Fee_Extend.Count; i++)
                {
                    Fees_Revenue_Info item = c_lst_Fee_Extend[i];

                    string _tem = item.Fee_Expected.ToString().Replace(",", "").Trim();
                    if (CheckValidate.CheckGiaDuong(_tem) == false)
                    {
                        tabExtend.Focus();
                        UpdateLayout();
                        DataGridHelper.NVSFocus(dgrFee_Extend, i, 2);
                        return(false);
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                ErrorLog.log.Error(ex.ToString());
                return(false);
            }
        }