public ConfigAccount() { ConfigChannel channel = ConfigUtil.LoadJSONConfig <ConfigChannel>("DataPersistent/BuildChannel/ChannelConfig"); this.accountBranch = channel.AccountBranch; this.paymentBranch = channel.PaymentBranch; }
protected List <AccountBranch> getAccountBranch(int branchId) { List <AccountBranch> listAB = new List <AccountBranch>(); ds.Clear(); res = Database.ExecuteQuery(String.Format("select * from BranchAccount where id_branch={0}", branchId), ref ds, null); if (ds != null && ds.Tables.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { int pt = Convert.ToInt32(ds.Tables[0].Rows[i]["product_type"]); if (pt != 0 && Enum.IsDefined(typeof(BaseProductType), pt)) { int at = Convert.ToInt32(ds.Tables[0].Rows[i]["account_type"]); if (at != 0 && Enum.IsDefined(typeof(AccountBranchType), at)) { AccountBranch ab = new AccountBranch(); ab.productType = (BaseProductType)pt; ab.accountType = (AccountBranchType)at; ab.accountDebet = ds.Tables[0].Rows[i]["account_debet"].ToString(); ab.accountCredit = ds.Tables[0].Rows[i]["account_credit"].ToString(); listAB.Add(ab); } } } } return(listAB); }
protected List <AccountBranch> getAccountBranch() { List <AccountBranch> listAB = new List <AccountBranch>(); AccountBranch ab = new AccountBranch(); ab.productType = BaseProductType.MasterCard; ab.accountType = AccountBranchType.In; ab.accountDebet = mastercardInDebet.Text; ab.accountCredit = mastercardInCredit.Text; listAB.Add(ab); ab = new AccountBranch(); ab.productType = BaseProductType.MasterCard; ab.accountType = AccountBranchType.Out; ab.accountDebet = mastercardOutDebet.Text; ab.accountCredit = mastercardOutCredit.Text; listAB.Add(ab); ab = new AccountBranch(); ab.productType = BaseProductType.MasterCard; ab.accountType = AccountBranchType.Return; ab.accountDebet = mastercardRetDebet.Text; ab.accountCredit = mastercardRetCredit.Text; listAB.Add(ab); ab = new AccountBranch(); ab.productType = BaseProductType.VisaCard; ab.accountType = AccountBranchType.In; ab.accountDebet = visaInDebet.Text; ab.accountCredit = visaInCredit.Text; listAB.Add(ab); ab = new AccountBranch(); ab.productType = BaseProductType.VisaCard; ab.accountType = AccountBranchType.Out; ab.accountDebet = visaOutDebet.Text; ab.accountCredit = visaOutCredit.Text; listAB.Add(ab); ab = new AccountBranch(); ab.productType = BaseProductType.VisaCard; ab.accountType = AccountBranchType.Return; ab.accountDebet = visaRetDebet.Text; ab.accountCredit = visaRetCredit.Text; listAB.Add(ab); ab = new AccountBranch(); ab.productType = BaseProductType.NFCCard; ab.accountType = AccountBranchType.In; ab.accountDebet = nfcInDebet.Text; ab.accountCredit = nfcInCredit.Text; listAB.Add(ab); ab = new AccountBranch(); ab.productType = BaseProductType.NFCCard; ab.accountType = AccountBranchType.Out; ab.accountDebet = nfcOutDebet.Text; ab.accountCredit = nfcOutCredit.Text; listAB.Add(ab); ab = new AccountBranch(); ab.productType = BaseProductType.NFCCard; ab.accountType = AccountBranchType.Return; ab.accountDebet = nfcRetDebet.Text; ab.accountCredit = nfcRetCredit.Text; listAB.Add(ab); ab = new AccountBranch(); ab.productType = BaseProductType.ServiceCard; ab.accountType = AccountBranchType.In; ab.accountDebet = srvInDebet.Text; ab.accountCredit = srvInCredit.Text; listAB.Add(ab); ab = new AccountBranch(); ab.productType = BaseProductType.ServiceCard; ab.accountType = AccountBranchType.Out; ab.accountDebet = srvOutDebet.Text; ab.accountCredit = srvOutCredit.Text; listAB.Add(ab); ab = new AccountBranch(); ab.productType = BaseProductType.ServiceCard; ab.accountType = AccountBranchType.Return; ab.accountDebet = srvRetDebet.Text; ab.accountCredit = srvRetCredit.Text; listAB.Add(ab); ab = new AccountBranch(); ab.productType = BaseProductType.PinConvert; ab.accountType = AccountBranchType.In; ab.accountDebet = pinInDebet.Text; ab.accountCredit = pinInCredit.Text; listAB.Add(ab); ab = new AccountBranch(); ab.productType = BaseProductType.PinConvert; ab.accountType = AccountBranchType.Out; ab.accountDebet = pinOutDebet.Text; ab.accountCredit = pinOutCredit.Text; listAB.Add(ab); ab = new AccountBranch(); ab.productType = BaseProductType.PinConvert; ab.accountType = AccountBranchType.Return; ab.accountDebet = pinRetDebet.Text; ab.accountCredit = pinRetCredit.Text; listAB.Add(ab); ab = new AccountBranch(); ab.productType = BaseProductType.MirCard; ab.accountType = AccountBranchType.In; ab.accountDebet = mirInDebet.Text; ab.accountCredit = mirInCredit.Text; listAB.Add(ab); ab = new AccountBranch(); ab.productType = BaseProductType.MirCard; ab.accountType = AccountBranchType.Out; ab.accountDebet = mirOutDebet.Text; ab.accountCredit = mirOutCredit.Text; listAB.Add(ab); ab = new AccountBranch(); ab.productType = BaseProductType.MirCard; ab.accountType = AccountBranchType.Return; ab.accountDebet = mirRetDebet.Text; ab.accountCredit = mirRetCredit.Text; listAB.Add(ab); return(listAB); }
protected void setAccountBranch(AccountBranch ab) { if (ab.productType == BaseProductType.MasterCard) { if (ab.accountType == AccountBranchType.In) { mastercardInDebet.Text = ab.accountDebet; mastercardInCredit.Text = ab.accountCredit; } if (ab.accountType == AccountBranchType.Out) { mastercardOutDebet.Text = ab.accountDebet; mastercardOutCredit.Text = ab.accountCredit; } if (ab.accountType == AccountBranchType.Return) { mastercardRetDebet.Text = ab.accountDebet; mastercardRetCredit.Text = ab.accountCredit; } } if (ab.productType == BaseProductType.VisaCard) { if (ab.accountType == AccountBranchType.In) { visaInDebet.Text = ab.accountDebet; visaInCredit.Text = ab.accountCredit; } if (ab.accountType == AccountBranchType.Out) { visaOutDebet.Text = ab.accountDebet; visaOutCredit.Text = ab.accountCredit; } if (ab.accountType == AccountBranchType.Return) { visaRetDebet.Text = ab.accountDebet; visaRetCredit.Text = ab.accountCredit; } } if (ab.productType == BaseProductType.NFCCard) { if (ab.accountType == AccountBranchType.In) { nfcInDebet.Text = ab.accountDebet; nfcInCredit.Text = ab.accountCredit; } if (ab.accountType == AccountBranchType.Out) { nfcOutDebet.Text = ab.accountDebet; nfcOutCredit.Text = ab.accountCredit; } if (ab.accountType == AccountBranchType.Return) { nfcRetDebet.Text = ab.accountDebet; nfcRetCredit.Text = ab.accountCredit; } } if (ab.productType == BaseProductType.ServiceCard) { if (ab.accountType == AccountBranchType.In) { srvInDebet.Text = ab.accountDebet; srvInCredit.Text = ab.accountCredit; } if (ab.accountType == AccountBranchType.Out) { srvOutDebet.Text = ab.accountDebet; srvOutCredit.Text = ab.accountCredit; } if (ab.accountType == AccountBranchType.Return) { srvRetDebet.Text = ab.accountDebet; srvRetCredit.Text = ab.accountCredit; } } if (ab.productType == BaseProductType.PinConvert) { if (ab.accountType == AccountBranchType.In) { pinInDebet.Text = ab.accountDebet; pinInCredit.Text = ab.accountCredit; } if (ab.accountType == AccountBranchType.Out) { pinOutDebet.Text = ab.accountDebet; pinOutCredit.Text = ab.accountCredit; } if (ab.accountType == AccountBranchType.Return) { pinRetDebet.Text = ab.accountDebet; pinRetCredit.Text = ab.accountCredit; } } if (ab.productType == BaseProductType.MirCard) { if (ab.accountType == AccountBranchType.In) { mirInDebet.Text = ab.accountDebet; mirInCredit.Text = ab.accountCredit; } if (ab.accountType == AccountBranchType.Out) { mirOutDebet.Text = ab.accountDebet; mirOutCredit.Text = ab.accountCredit; } if (ab.accountType == AccountBranchType.Return) { mirRetDebet.Text = ab.accountDebet; mirRetCredit.Text = ab.accountCredit; } } }