예제 #1
0
        public void PrintReceipt(Transactions ts, CustomerBO ub)
        {
            MainBLL bll = new MainBLL();

            ub = bll.GetCurrentUser(null, null, ub.AccountNo);
            WriteLine($"\nAccount #{ub.AccountNo}\nDate: {ts.DT}\n\n{ts.Type.ToUpper()}: {ts.Balance}\nBalance: {ub.Balance}");
        }
예제 #2
0
        private void ShowBestBook()
        {
            SqlDataReader dr = MainBLL.SelectMainBestBook();

            this.repRecommend.DataSource = dr;
            this.repRecommend.DataBind();
        }
예제 #3
0
        public void DisplayBalance()        //to display current user balance.
        {
            MainBLL    bll = new MainBLL();
            CustomerBO ub  = bll.GetCurrentUser(null, null, cbo.AccountNo);

            WriteLine($"\nAccount #{ub.AccountNo}\nDate: {DateTime.Now}\nBalance: {ub.Balance}");
        }
예제 #4
0
        private void LoadMsg()
        {
            SqlDataReader dr = MainBLL.LoadMsg();

            this.repHead.DataSource = dr;
            this.repHead.DataBind();
        }
예제 #5
0
 public fmDmgReport()
 {
     InitializeComponent();
     bll = new MainBLL();
     this.dgvDmgInfo.AutoGenerateColumns   = false;
     this.dgvDmgInfoEx.AutoGenerateColumns = false;
 }
예제 #6
0
        private void ShowNewBook()
        {
            SqlDataReader dr = MainBLL.SelectNewBook();

            this.repNewBook.DataSource = dr;
            this.repNewBook.DataBind();
        }
예제 #7
0
 private void getModel(string guid)
 {
     if (guid != "")
     {
         InsuranceAndReviewModel model = this.IARBLL.GetModel(new Guid(guid));
         if (model != null)
         {
             this.hideIARGUID.Value = guid;
             this.txtcode.Text      = model.code;
             if (model.code != "")
             {
                 if (model.Type == 0)
                 {
                     this.rado.Items[0].Selected = true;
                 }
                 else
                 {
                     this.rado.Items[1].Selected = true;
                 }
             }
             this.txtDate.Text = ((model.Date == null) ? "" : DateTime.Parse(model.Date.ToString()).ToShortDateString());
             MainBLL mainBLL = new MainBLL();
             if (mainBLL.Exists(new Guid(model.VehicleCode.ToString())))
             {
                 this.Hidden_save_SID.Value = model.VehicleCode.ToString();
             }
         }
     }
 }
예제 #8
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (txtUser.Text.Trim() == "")
            {
                MessageBox.Show("User name must be entered !");
                txtUser.Focus();
                return;
            }
            if (txtPass.Text.Trim() == "")
            {
                MessageBox.Show("Password must be entered");
                txtPass.Focus();
                return;
            }
            MainBLL mainBll = new MainBLL();

            if (mainBll.Login(txtUser.Text, txtPass.Text) == true)
            {
                frmMain FormCls = new frmMain();
                FormCls.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("User authentication failed !");
                txtUser.Focus();
            }
        }
예제 #9
0
        public fmMain()
        {
            InitializeComponent();

            InitScaler();

            bll = new MainBLL(InitCntCtrl());
        }
예제 #10
0
        public fmExpHandle()
        {
            InitializeComponent();

            InitScaler();

            bll = new MainBLL(InitCntCtrl());

            dgvData.AutoGenerateColumns = false;
        }
예제 #11
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(this.hfldContractTypeGuid.Value))
     {
         List <string> list = new List <string>();
         if (this.hfldContractTypeGuid.Value.Contains("["))
         {
             list = JsonHelper.GetListFromJson(this.hfldContractTypeGuid.Value);
         }
         else
         {
             list.Add(this.hfldContractTypeGuid.Value);
         }
         if (list.Count > 0)
         {
             for (int i = 0; i < list.Count; i++)
             {
                 List <TypeAndState> modelList = this.TASBLL.GetModelList("ParentGuid='" + new Guid(list[i].ToString()) + "'");
                 if (this.TASBLL.GetModel(new Guid(list[i].ToString())).ParentGuid.ToString() == default(Guid).ToString() && modelList.Count > 0)
                 {
                     StringBuilder stringBuilder = new StringBuilder();
                     stringBuilder.Append("alert('系统提示:\\n\\n 类型正在使用!');").Append(Environment.NewLine);
                     base.RegisterScript(stringBuilder.ToString());
                     break;
                 }
                 MainBLL mainBLL = new MainBLL();
                 if (mainBLL.Exists(string.Concat(new string[]
                 {
                     "VehicleType='",
                     list[i].ToString(),
                     "' or State='",
                     list[i].ToString(),
                     "'"
                 })))
                 {
                     StringBuilder stringBuilder2 = new StringBuilder();
                     stringBuilder2.Append("alert('系统提示:\\n\\n 类型正在使用!');").Append(Environment.NewLine);
                     base.RegisterScript(stringBuilder2.ToString());
                     break;
                 }
                 this.TASBLL.Delete(new Guid(list[i].ToString()));
             }
             this.DataBindContractType();
             this.DataBindProject();
             this.KeepTreeViewState();
         }
     }
 }
예제 #12
0
        private void NextRecord()
        {
            this.Cursor = Cursors.WaitCursor;
            try
            {
                if ((row != null && row.CSTATUS == Convert.ToInt32(Config.CStatus.Fetched)) ||
                    (numMoves.Value > 1 && row2 != null && row2.CSTATUS == Convert.ToInt32(Config.CStatus.Fetched)))
                {
                    //加载图片
                    LoadPhotos();

                    MessageBox.Show("当前记录未处理!");
                    return;
                }

                InitCntCtrl();

                DataSet1.T_OCRX_CNTDataTable dt = bll.SelectNextRecord(UserId, CompanyCode);

                if (dt == null || dt.Rows.Count == 0)
                {
                    ClearImg();
                    MessageBox.Show("没有未处理的记录,请稍后再尝试");
                    return;
                }

                bll = new MainBLL(InitCntCtrl());

                row  = dt[0];
                row2 = dt.Count > 1 ? dt[1] : null;

                bll.row1 = row;
                bll.row2 = row2;

                //顶部信息
                lblLoadDis.Text   = row.DOCK_STATUS == 0 ? "装船" : "卸船";
                lblLoadPos.Text   = ""; //?暂时不填
                lblQC.Text        = row.TRVAL_NO;
                lblVessel.Text    = row.SHIP_CODE;
                lblVoyage.Text    = row.C_VOYAGE;
                lblService.Text   = row.SERVICECODE;
                lblShipAgent.Text = row.SHIPAGENT;
                lblBerth.Text     = row.BERTH_NUM;

                btnUp.Enabled   = true;
                btnDown.Enabled = true;

                //加载图片
                LoadPhotos();

                //填充箱信息
                cntResult = bll.InitCntCtrl(row);

                numMoves.Focus();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
예제 #13
0
        public void CreateNewAccount() //to create user account with all validations and takes input in a customer object
        {                              //and then send that object to bll to create account.
            MainBLL bllTemp = new MainBLL();

            WriteLine("CREATE NEW ACCOUNT\n\n");
            bool checkValidity;

d1:
            Write("Login: "******"\n=> Login ID only contains numbers or characters\n");
                goto d1;
            }
            if (isAlreadyExist)
            {
                WriteLine("\n=> Login ID already Exists\n");
                goto d1;
            }
d3:
            Write("User ID: ");
            cbo.UserID     = ReadLine();
            checkValidity  = bllTemp.DigitValidation(cbo.UserID);          //userid validation
            isAlreadyExist = bllTemp.isLoginUseridExist(null, cbo.UserID); //check account exist or not based on user id
            if (cbo.UserID == "" || !checkValidity || cbo.UserID.Length != 5)
            {
                WriteLine("\n=> User ID only contains numbers - User ID must be 5 characters long\n");
                goto d3;
            }
            if (isAlreadyExist)
            {
                WriteLine("\n=> User ID already Exists\n");
                goto d3;
            }
d4:
            Write("Pin Code: ");
            cbo.Pin       = ReadLine();
            checkValidity = bllTemp.DigitValidation(cbo.Pin);       //pin validation
            if (cbo.Pin == "" || !checkValidity || cbo.Pin.Length != 5)
            {
                WriteLine("\n=> Pin only contains numbers - Pin must be of 5 digit long\n");
                goto d4;
            }
i1:
            Write("Holder's Name: ");
            cbo.Name = ReadLine();
            if (cbo.Name == "")
            {
                WriteLine("\n=> Name must not be empty\n");
                goto i1;
            }
d5:
            Write("Type(Savings, Current): ");
            cbo.Type      = ReadLine().ToLower();
            checkValidity = bllTemp.TypeValidation(cbo.Type);       //type validation
            if (cbo.Type == "" || !checkValidity)
            {
                WriteLine("\n=> There are only two types(Savings, Current)\n");
                goto d5;
            }
d7:
            Write("Starting Balance: ");
            string tmp     = ReadLine();
            bool   isValid = bllTemp.AmountValidation(tmp);     //amount validation

            if (!isValid)
            {
                WriteLine("\n=> Invalid Input\n");
                goto d7;
            }
            cbo.Balance = decimal.Parse(tmp);
d6:
            Write("Status: ");
            cbo.Status    = ReadLine().ToLower();
            checkValidity = bllTemp.StatusValidation(cbo.Status);       //status validation
            if (cbo.Status == "" || !checkValidity)
            {
                WriteLine("\n=> There can be only two statuses of account(Active, Disable)\n");
                goto d6;
            }
            cbo.AccountNo = bllTemp.LastAccountNumber() + 1;
            WriteLine($"\n=> Account Sucessfully Created - the account number assigned is: {cbo.AccountNo}");
            MainBLL bll = new MainBLL();

            bll.CreateCustomerAccount(cbo);
        }
예제 #14
0
        private void btnNext_Click_1(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            try
            {
                cnts = bll.SelectExcep(fmMain.CompanyCode);
                dgvData.DataSource = cnts;

                if (dgvData.DataSource == null)
                {
                    return;
                }

                if (cnts.Count == 0)
                {
                    return;
                }


                InitCntCtrl();

                bll = new MainBLL(InitCntCtrl());

                row = (DataSet1.T_OCRX_CNTRow)((DataRowView)dgvData.CurrentRow.DataBoundItem).Row;

                //双吊找第二个柜
                if (row.CTYPE == 1)
                {
                    foreach (DataSet1.T_OCRX_CNTRow rr in cnts)
                    {
                        if (rr.MSG_INDEX == row.MSG_INDEX && rr.TRVAL_NO == row.TRVAL_NO)
                        {
                            row2 = rr;
                        }
                    }
                }
                //row2 = dt.Count > 1 ? dt[1] : null;

                bll.row1 = row;
                bll.row2 = row2;

                btnUp.Enabled   = true;
                btnDown.Enabled = true;

                //加载图片
                LoadPhotos();

                //填充箱信息
                cntResult = bll.InitCntCtrl(row);

                numMoves.Focus();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }