private void tsrbtnDelBill_Click(object sender, EventArgs e) { if (_currentMaster == null) { MessageBox.Show("请选中一行"); return; } if (_currentMaster.Audit_Flag == 1) { MessageBox.Show("不能对已审核单据进行操作"); return; } else { try { if (MessageBox.Show("您确认要删除所选单据么?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { _billProcessor = BillFactory.GetProcessor(_currentMaster.OpType); _billProcessor.DelBill(_currentMaster); LoadData(); } } catch (Exception error) { MessageBox.Show(error.Message); return; } } }
private void LoadData() { try { if (tabDispQuery.SelectedTab == tabPgSingle) { _billQuery = BillFactory.GetQuery(ConfigManager.OP_YF_DISPENSE); DataTable allMaster = _billQuery.LoadMaster(BuildConditionParams()); _dispMasterDt = allMaster.Clone(); if (cobOPType.Text == "门诊") { DataRow[] filterRows; if (txtQueryCode.Text == "") { filterRows = allMaster.Select("INVOICENUM<>0"); } else { filterRows = allMaster.Select("INVOICENUM=" + txtQueryCode.Text); } foreach (DataRow dr in filterRows) { _dispMasterDt.Rows.Add(dr.ItemArray); } } else { DataRow[] filterRows; if (txtQueryCode.Text == "") { filterRows = allMaster.Select("INVOICENUM=0"); } else { filterRows = allMaster.Select("INPATIENTID='" + txtQueryCode.Text + "' AND INVOICENUM=0"); } foreach (DataRow dr in filterRows) { _dispMasterDt.Rows.Add(dr.ItemArray); } } dgrdDRMaster.DataSource = _dispMasterDt; if (_dispOrderDt != null) { _dispOrderDt.Rows.Clear(); } } else { _billQuery = BillFactory.GetQuery(ConfigManager.OP_YF_DISPENSE + "ZY_TL"); _deptDispDt = _billQuery.LoadMaster(BuildConditionParams()); dgrdDispDept.AutoGenerateColumns = false; dgrdDispDept.DataSource = _deptDispDt; } } catch (Exception error) { throw error; } }
/// <summary> /// 打印采购计划单 /// </summary> /// <param name="billMaster">单据表头</param> /// <param name="billOrder">单据明细</param> /// <param name="path">报表文件路径</param> /// <param name="Printer">打印人员</param> public override void PrintBill(HIS.Model.BillMaster billMaster, System.Data.DataTable billOrder, string path, int Printer) { try { HIS.Model.YP_PlanMaster printMaster = (HIS.Model.YP_PlanMaster)billMaster; _printOrder = BillFactory.GetQuery(ConfigManager.OP_YK_STOCKPLAN).LoadOrder(printMaster); if (printMaster != null && _printOrder.Rows.Count > 0) { report = new grproLib.GridppReport(); report.LoadFromFile(path); report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord); report.ParameterByName("RegTime").AsDateTime = printMaster.RegTime; report.ParameterByName("RegPeopleName").AsString = printMaster.RegPeopleName; report.ParameterByName("TotalRetailFee").AsString = printMaster.RetailFee.ToString(); report.ParameterByName("TotalTradeFee").AsString = printMaster.TradeFee.ToString(); report.ParameterByName("HospitalName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName; report.ParameterByName("Printer").AsString = BaseData.GetUserName(Printer); report.ParameterByName("PrintTime").AsDateTime = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime; report.ParameterByName("DiffFee").AsString = (printMaster.RetailFee - printMaster.TradeFee).ToString(); report.PrintPreview(false); } } catch (Exception error) { throw error; } }
private void btnFind_Click(object sender, EventArgs e) { try { _billQuery = BillFactory.GetQuery(ConfigManager.OP_YF_DISPENSE); DataTable allMaster = _billQuery.LoadMaster(BuildConditionParams()); _dispMasterDt = allMaster.Clone(); DataRow[] filterRows; if (this.txtInvoiceNoQuery.Text.Trim() == "00000000") { filterRows = allMaster.Select("INVOICENUM<>0 and DrugOC_Flag=0"); } else { filterRows = allMaster.Select("INVOICENUM=" + Convert.ToInt32(txtInvoiceNoQuery.Text) + " and DrugOC_Flag=1"); } foreach (DataRow dr in filterRows) { _dispMasterDt.Rows.Add(dr.ItemArray); } dgrdDRMaster.AutoGenerateColumns = false; dgrdDRMaster.DataSource = _dispMasterDt; } catch (Exception error) { MessageBox.Show(error.Message); } }
private void FrmYFInMaster_Load(object sender, EventArgs e) { try { chkRegTime.Checked = true; cobPayState.SelectedIndex = 0; if (_belongSystem == ConfigManager.YF_SYSTEM) { _billQurey = BillFactory.GetQuery(ConfigManager.OP_YF_INSTORE); _billProcessor = BillFactory.GetProcessor(ConfigManager.OP_YF_INSTORE); tsrbtnPay.Visible = false; tsrbtnPrintTotal.Visible = false; dgrdInMaker.Columns["ColBtnBackStore"].Visible = false; } else { _billQurey = BillFactory.GetQuery(ConfigManager.OP_YK_INOPTYPE); _billProcessor = BillFactory.GetProcessor(ConfigManager.OP_YK_INOPTYPE); } LoadData(); } catch (Exception error) { MessageBox.Show(error.Message); } }
/// <summary> /// 打印门诊退药单据 /// </summary> /// <param name="billMaster">单据表头</param> /// <param name="billOrder">单据明细</param> /// <param name="path">报表文件路径</param> /// <param name="Printer">打印人员</param> public override void PrintBill(HIS.Model.BillMaster billMaster, System.Data.DataTable billOrder, string path, int Printer) { if (billMaster == null) { return; } _printOrder = BillFactory.GetQuery(ConfigManager.OP_YF_REFUND).LoadOrder(billMaster); if (_printOrder.Rows.Count > 0) { HIS.Model.YP_DRMaster printMaster = (HIS.Model.YP_DRMaster)billMaster; report = new grproLib.GridppReport(); report.LoadFromFile(path); report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(report_FetchRecord); report.ParameterByName("InvoiceNum").AsString = printMaster.InvoiceNum.ToString(); report.ParameterByName("UserName").AsString = BaseData.GetUserName(printMaster.OPPeopleID); report.ParameterByName("ExeTime").AsDateTime = printMaster.OPTime; report.ParameterByName("PatientName").AsString = printMaster.PatientName; report.ParameterByName("HospitalName").AsString = BaseData.WorkName; report.ParameterByName("DocName").AsString = BaseData.GetUserName(printMaster.DocID); report.ParameterByName("RecipeNo").AsString = printMaster.RecipeID.ToString(); report.ParameterByName("DeptName").AsString = BaseData.GetDeptName(printMaster.DeptID.ToString()); report.ParameterByName("Printer").AsString = BaseData.GetUserName(Printer); report.ParameterByName("PrintTime").AsDateTime = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime; report.PrintPreview(false); } }
/// <summary> /// 加载已发药消息列表 /// </summary> private void LoadDispHisMaster() { try { if (_recipeOrder != null) { _recipeOrder.Rows.Clear(); _recipeOrder = null; } BillQuery _billQuery = BillFactory.GetQuery(ConfigManager.OP_YF_DISPENSE); DataTable allMaster = _billQuery.LoadMaster(BuildConditionParams()); _dispMasterDt = allMaster.Clone(); foreach (DataRow dr in allMaster.Rows) { _dispMasterDt.Rows.Add(dr.ItemArray); } if (_dispOrderDt != null) { _dispOrderDt.Rows.Clear(); } treeDrugMsg.Nodes.Clear(); TreeNode allDeptNode = new TreeNode("全院科室"); allDeptNode.Tag = 0; allDeptNode.ImageIndex = 0; treeDrugMsg.Nodes.Add(allDeptNode); for (int index = 0; index < _deptDt.Rows.Count; index++) { TreeNode deptNode = new TreeNode(_deptDt.Rows[index]["NAME"].ToString()); deptNode.ImageIndex = 0; deptNode.Tag = Convert.ToInt32(_deptDt.Rows[index]["DEPT_ID"]); if (Convert.ToInt32(deptNode.Tag) > 0) { allDeptNode.Nodes.Add(deptNode); DataRow[] rows = _dispMasterDt.Select("currdeptcode='" + deptNode.Tag.ToString().Trim() + "'"); if (rows != null && rows.Length > 0) { for (int temp = 0; temp < rows.Length; temp++) { TreeNode msgNode = new TreeNode(); string nodetext = rows[temp]["patientname"].ToString() + "-- 发药时间 --" + Convert.ToDateTime(rows[temp]["optime"]).ToString("yyyy-MM-dd HH:mm:ss"); msgNode.Text = nodetext; if (rows[temp]["optype"].ToString() == "004") { msgNode.ForeColor = Color.Red; } msgNode.Tag = rows[temp]; deptNode.Nodes.Add(msgNode); } } } deptNode.Expand(); } allDeptNode.Expand(); } catch (Exception error) { throw error; } }
public ZYFrmPresDispense(long currentUserId, long currentDeptId) { _currentUserId = currentUserId; _currentDeptId = currentDeptId; InitializeComponent(); _billProcessor = BillFactory.GetProcessor(ConfigManager.OP_YF_DISPENSE + "ZY_ECONOMY"); }
private void FrmYFInMaster_Load(object sender, EventArgs e) { chkRegTime.Checked = true; radNotAudit.Checked = true; _billProcessor = BillFactory.GetProcessor(ConfigManager.OP_YF_APPLYIN); LoadData(); }
public ZYFrmDrugRefund(long currentUserId, long currentDeptId, string chineseName) { _currentUserId = currentUserId; _currentDeptId = currentDeptId; _chineseName = chineseName; _billProcessor = BillFactory.GetProcessor(ConfigManager.OP_YF_REFUND + "ZY"); this.Text = _chineseName; InitializeComponent(); }
static void Main(string[] args) { BillFactory billFactory = new BillFactory(); int n = billFactory.CreateAccount(10, Account.Current); Building building = FactoryBuilding.CreateBuilding(10, 10, 2); building.ToString(); }
public ZYFrmDrugDispenseJG(long currentUserId, long currentDeptId, string chineseName) { _currentUserId = currentUserId; _currentDeptId = currentDeptId; _chineseName = chineseName; InitializeComponent(); this.Text = _chineseName; _billProcessor = BillFactory.GetProcessor(ConfigManager.OP_YF_DISPENSE + "ZY_ECONOMY"); }
public MZFrmDrugRefund(long currentUserId, long currentDeptId, string chineseName) { _currentUserId = currentUserId; _currentDeptId = currentDeptId; _chineseName = chineseName; _billProcessor = BillFactory.GetProcessor(ConfigManager.OP_YF_REFUND + "MZ"); _billQuery = BillFactory.GetQuery(ConfigManager.OP_YF_DISPENSE); InitializeComponent(); this.Text = _chineseName; }
private void tabDispQuery_SelectedIndexChanged(object sender, EventArgs e) { if (tabDispQuery.SelectedTab == tabPgSingle) { _billQuery = BillFactory.GetQuery(ConfigManager.OP_YF_DISPENSE); } else { _billQuery = BillFactory.GetQuery(ConfigManager.OP_YF_DISPENSE + "ZY_TL"); } }
private void FrmDispenseQuery_Load(object sender, EventArgs e) { try { _billQuery = BillFactory.GetQuery(ConfigManager.OP_YF_DISPENSE); cobOPType.SelectedIndex = 0; LoadData(); } catch (Exception error) { MessageBox.Show(error.Message); } }
public FrmYFApplyorder(long currentUserId, long currentDeptId, int beginState, bool isBuildByLimit) { _currentUserId = currentUserId; _currentDeptId = currentDeptId; _currentState = beginState; _isBuildByLimit = isBuildByLimit; _billProcessor = BillFactory.GetProcessor(ConfigManager.OP_YF_APPLYIN); _billQuery = BillFactory.GetQuery(ConfigManager.OP_YF_APPLYIN); _storeQuery = StoreFactory.GetQuery(ConfigManager.YK_SYSTEM); InitializeComponent(); //设置起始焦点 }
private void treeDrugMsg_AfterSelect(object sender, TreeViewEventArgs e) { if (tabMsgMaster.SelectedIndex == 0 && e.Node != null) { if (e.Node.Level == 2) { ShowCurrentPat(((ZY_PatList)e.Node.Tag).CureNo); } } else if (tabMsgMaster.SelectedIndex == 1 && e.Node != null) { try { if (e.Node.Level == 2) { BillQuery _billQuery = BillFactory.GetQuery(ConfigManager.OP_YF_DISPENSE); dgrdDROrder.AutoGenerateColumns = false; dgrdDROrder.ClearLines(); DataTable dt = _dispMasterDt.Clone(); dt.Clear(); dt.Rows.Add(((DataRow)e.Node.Tag).ItemArray); HIS.SYSTEM.PubicBaseClasses.ApiFunction.DataTableToObject(dt, 0, _currentMaster); DataTable dtDrugs = _billQuery.LoadOrder(_currentMaster); for (int i = 0; i < dtDrugs.Rows.Count; i++) { decimal presamount = (dtDrugs.Rows[i]["recipenum"] == null || dtDrugs.Rows[i]["recipenum"].ToString() == "0" ? 1 : Convert.ToDecimal(dtDrugs.Rows[i]["recipenum"].ToString())); dtDrugs.Rows[i]["drugocnum"] = Convert.ToDecimal(dtDrugs.Rows[i]["drugocnum"].ToString()) / presamount; } if (_currentMaster.OpType == "004") { for (int i = 0; i < dtDrugs.Rows.Count; i++) { dtDrugs.Rows[i]["drugocnum"] = -1 * Convert.ToDecimal(dtDrugs.Rows[i]["drugocnum"]); dtDrugs.Rows[i]["recipenum"] = -1 * Convert.ToDecimal(dtDrugs.Rows[i]["recipenum"]); } } dgrdDROrder.DataSource = dtDrugs; } } catch (Exception error) { MessageBox.Show(error.Message); } finally { this.Cursor = DefaultCursor; } } }
/// <summary> /// 加载已发药消息列表 /// </summary> private void LoadDispHisMaster() { try { if (_recipeOrder != null) { _recipeOrder.Rows.Clear(); _recipeOrder = null; } BillQuery _billQuery = BillFactory.GetQuery(ConfigManager.OP_YF_DISPENSE + "ZY_TL"); DataTable deptDispDt = _billQuery.LoadMaster(BuildConditionParams()); treeDrugMsg.Nodes.Clear(); TreeNode allDeptNode = new TreeNode("全院科室"); allDeptNode.Tag = 0; allDeptNode.ImageIndex = 0; treeDrugMsg.Nodes.Add(allDeptNode); for (int index = 0; index < _deptDt.Rows.Count; index++) { TreeNode deptNode = new TreeNode(_deptDt.Rows[index]["NAME"].ToString()); deptNode.ImageIndex = 0; deptNode.Tag = Convert.ToInt32(_deptDt.Rows[index]["DEPT_ID"]); if (Convert.ToInt32(deptNode.Tag) > 0) { allDeptNode.Nodes.Add(deptNode); if (deptDispDt != null) { for (int temp = 0; temp < deptDispDt.Rows.Count; temp++) { DataRow currentRow = deptDispDt.Rows[temp]; if (Convert.ToInt32(currentRow["DISPDEPT"]) == Convert.ToInt32(deptNode.Tag)) { TreeNode msgNode = new TreeNode(); string date = Convert.ToDateTime(currentRow["OPTIME"]).ToString("yyyy-MM-dd HH:mm"); msgNode.Text = date; msgNode.Tag = currentRow; deptNode.Nodes.Add(msgNode); } } } } deptNode.Expand(); } allDeptNode.Expand(); } catch (Exception error) { throw error; } }
public FrmStockControl(IFrmStockPlan frmstockplan) { try { _frmstockplan = frmstockplan; _drugInfo = DrugBaseDataBll.YD_LoadDrugInfo(0, 0); _frmstockplan.RefreshDurgInfo(_drugInfo); _billProcessor = BillFactory.GetProcessor(ConfigManager.OP_YK_STOCKPLAN); _billQuery = BillFactory.GetQuery(ConfigManager.OP_YK_STOCKPLAN); } catch (Exception error) { throw error; } }
private void LoadData() { try { dgrdInMaker.AutoGenerateColumns = false; dgrdInOrder.AutoGenerateColumns = false; _masterDt = BillFactory.GetQuery(ConfigManager.OP_YF_APPLYIN).LoadMaster(BuildConditionParams()); this.dgrdInMaker.DataSource = _masterDt; dgrdInMaker_CurrentCellChanged(null, null); } catch (Exception error) { MessageBox.Show(error.Message); } }
public void Discount_Test() { BillFactory factory = new BillFactory(); Goods cola = factory.Create("Special", "Cola"); Item i1 = new Item(cola, 6, 65); Customer x = new Customer("Vadim&Volodya", 10); IPresenter p = new TXTPresenter(); BillGenerator b1 = new BillGenerator(x, p); b1.addGoods(i1); string bill = b1.GenerateBill(); double actual = b1.discount_1; double exepted = 13.9; Assert.AreEqual(exepted, actual); }
public FrmOutMaster(long currentUserId, long currentDeptId, string chineseName, string belongSystem) { _currentUserId = currentUserId; _currentDeptId = currentDeptId; _chineseName = chineseName; this.Text = _chineseName; _belongSystem = belongSystem; if (_belongSystem == ConfigManager.YK_SYSTEM) { _billQuery = BillFactory.GetQuery(ConfigManager.DEF_YK_OUT); } else { _billQuery = BillFactory.GetQuery(ConfigManager.DEF_YF_OUT); } InitializeComponent(); }
private void FrmOutOrder_Load(object sender, EventArgs e) { txtApplyPeople.Text = new User(_currentUserId).Name; if (_opType == ConfigManager.OP_YK_REPORTLOSS || _opType == ConfigManager.OP_YF_REPORTLOSS) { txtOpType.Text = "药品报损"; txtOutDept.Text = "无领药科室"; txtOutDept.ReadOnly = true; txtApplyPeople.ReadOnly = true; txtByOptype.ReadOnly = false; } else { this.txtOpType.Text = "科室领药"; txtByOptype.ReadOnly = true; } if (_belongSystem == ConfigManager.YK_SYSTEM) { _billQuery = BillFactory.GetQuery(ConfigManager.DEF_YK_OUT); } else if (_belongSystem == ConfigManager.YF_SYSTEM) { _billQuery = BillFactory.GetQuery(ConfigManager.DEF_YF_OUT); txtBatchNum.ReadOnly = true; } _billProcessor = BillFactory.GetProcessor(_opType); //如果是添加单据状态 if (_currentState == ADD) { //生成一个新的单据表头 _currentMaster = (YP_OutMaster)(_billProcessor.BuildNewMaster(_currentDeptId, _currentUserId)); _currentMaster.OpType = _opType; _currentOrder = (YP_OutOrder)(_billProcessor.BuildNewoder(_currentDeptId, _currentMaster)); LoadData(); } else if (_currentState == UPDATE) { _currentOrder = (YP_OutOrder)(_billProcessor.BuildNewoder(_currentDeptId, _currentMaster)); LoadData(); dgrdOrderInfo_CurrentCellChanged(null, null); } //显示当前表头信息 ShowCurrentMaster(); }
public FrmYPAdjMaster(long currentUserId, long currentDeptId, string chineseName, string belongSystem) { _currentUserId = currentUserId; _currentDeptId = currentDeptId; _chineseName = chineseName; _belongSystem = belongSystem; if (_belongSystem == ConfigManager.YF_SYSTEM) { _billQuery = BillFactory.GetQuery(ConfigManager.OP_YF_ADJPRICE); _billProcessor = BillFactory.GetProcessor(ConfigManager.OP_YF_ADJPRICE); } else { _billQuery = BillFactory.GetQuery(ConfigManager.OP_YK_ADJPRICE); _billProcessor = BillFactory.GetProcessor(ConfigManager.OP_YK_ADJPRICE); } InitializeComponent(); }
private void txtOutDept_AfterSelectedRow(object sender, object SelectedValue) { if (txtOutDept.ReadOnly == true) { return; } DataRow dr = (DataRow)SelectedValue; if (dr != null) { //add 平级药房调拨 张运辉 [20100531] if (dr["TYPE_CODE"].ToString() == "002") { _opType = ConfigManager.OP_YF_PJDB; _billProcessor = BillFactory.GetProcessor(_opType); } _currentMaster.OutDeptId = Convert.ToInt32(txtOutDept.MemberValue); } }
public void Bonus_Test() { BillFactory factory = new BillFactory(); Goods cola = factory.Create("Special", "Cola"); Goods pepsi = factory.Create("Sale", "Pepsi"); Item i1 = new Item(cola, 6, 65); Item i2 = new Item(pepsi, 3, 50); Customer x = new Customer("Vadim&Volodya", 10); IPresenter p = new TXTPresenter(); BillGenerator b1 = new BillGenerator(x, p); b1.addGoods(i1); b1.addGoods(i2); string bill = b1.GenerateBill(); double actual = b1.bonus; double exepted = 10; Assert.AreEqual(exepted, actual); }
public FrmCheckMaster(long currentUserId, long currentDeptId, string chineseName, string belongSystem) { _currentUserId = currentUserId; _currentDeptId = currentDeptId; _chineseName = chineseName; this.Text = _chineseName; _belongSystem = belongSystem; if (_belongSystem == ConfigManager.YF_SYSTEM) { _billProcessor = BillFactory.GetProcessor(ConfigManager.OP_YF_CHECK); _billQuery = BillFactory.GetQuery(ConfigManager.OP_YF_CHECK); } else if (_belongSystem == ConfigManager.YK_SYSTEM) { _billProcessor = BillFactory.GetProcessor(ConfigManager.OP_YK_CHECK); _billQuery = BillFactory.GetQuery(ConfigManager.OP_YK_CHECK); } InitializeComponent(); }
private void FrmCheckOrder_Load(object sender, EventArgs e) { try { dgrdCheckOrder.ColumnHeadersDefaultCellStyle.Font = new Font("宋体", (float)9); if (_belongSystem == ConfigManager.YK_SYSTEM) { dgrdCheckOrder.Columns.Remove("AccountNum"); dgrdCheckOrder.Columns.Remove("UnitName"); dgrdCheckOrder.Columns.Remove("CheckNum"); _billProcessor = BillFactory.GetProcessor(ConfigManager.OP_YK_CHECK); _billQuery = BillFactory.GetQuery(ConfigManager.OP_YK_CHECK); txtFtPackNum.TextFormat = GWI.HIS.Windows.Controls.TextFormatStyle.Numberic; txtFtBaseNum.ReadOnly = true; } else if (_belongSystem == ConfigManager.YF_SYSTEM) { _billProcessor = BillFactory.GetProcessor(ConfigManager.OP_YF_CHECK); _billQuery = BillFactory.GetQuery(ConfigManager.OP_YF_CHECK); dgrdCheckOrder.Columns.Remove("BatchNum"); cobValidityDate.Enabled = false; } if (_currentState == UPDATE) { this.tsrbtnLoadData.Visible = false; this.txtDgCode.ReadOnly = true; this.btnAddOrder.Enabled = false; this.btnDelOrder.Enabled = false; } _checkOrderDt = _billQuery.LoadOrder(_currentMaster); dgrdCheckOrder.DataSource = _checkOrderDt; _drugInfoDt = _storeQuery.GetCheckDrug((int)_currentDeptId); txtDgCode.SetSelectionCardDataSource(_drugInfoDt); txtQueryCode.SetSelectionCardDataSource(_drugInfoDt); ShowCurrentMaster(); } catch (Exception error) { MessageBox.Show(error.Message); } }
public void BaseTest() { BillFactory factory = new BillFactory(); Goods fanta = factory.Create("Regular", "Fanta"); Goods snikers = factory.Create("Sale", "snikers"); int price_for_fanta = 45; int price_for_snikers = 33; Item i1 = new Item(fanta, 2, price_for_fanta); Item i2 = new Item(snikers, 3, price_for_snikers); Customer Denis = new Customer("Vadim&Volodya", 10); IPresenter p = new TXTPresenter(); BillGenerator b1 = new BillGenerator(Denis, p); b1.addGoods(i1); b1.addGoods(i2); string bill = b1.GenerateBill(); string actual = bill; string exepted = b1.GenerateBill(); Assert.AreEqual(exepted, actual); }
public void HTML_Presenter_test() { BillFactory factory = new BillFactory(); Goods cola = factory.Create("Regular", "Cola"); Goods pepsi = factory.Create("Sale", "Pepsi"); int price_for_fanta = 45; int price_for_snikers = 33; Item i1 = new Item(cola, 2, price_for_fanta); Item i2 = new Item(pepsi, 3, price_for_snikers); Customer Denis = new Customer("Vadim&Volodya", 10); IPresenter p = new HTMLPresenter(); BillGenerator b1 = new BillGenerator(Denis, p); b1.addGoods(i1); b1.addGoods(i2); string bill = b1.GenerateBill(); string actual = bill; string exepted = b1.GenerateBill(); Assert.AreEqual(exepted, actual); }