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}"); }
private void ShowBestBook() { SqlDataReader dr = MainBLL.SelectMainBestBook(); this.repRecommend.DataSource = dr; this.repRecommend.DataBind(); }
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}"); }
private void LoadMsg() { SqlDataReader dr = MainBLL.LoadMsg(); this.repHead.DataSource = dr; this.repHead.DataBind(); }
public fmDmgReport() { InitializeComponent(); bll = new MainBLL(); this.dgvDmgInfo.AutoGenerateColumns = false; this.dgvDmgInfoEx.AutoGenerateColumns = false; }
private void ShowNewBook() { SqlDataReader dr = MainBLL.SelectNewBook(); this.repNewBook.DataSource = dr; this.repNewBook.DataBind(); }
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(); } } } }
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(); } }
public fmMain() { InitializeComponent(); InitScaler(); bll = new MainBLL(InitCntCtrl()); }
public fmExpHandle() { InitializeComponent(); InitScaler(); bll = new MainBLL(InitCntCtrl()); dgvData.AutoGenerateColumns = false; }
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(); } } }
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; } }
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); }
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; } }