protected void btn_submit_Click(object sender, EventArgs e) { SellService sell = new SellService(); string account = Session["UserAccount"].ToString().Trim(); Label1.Text = sell.inquireProfit(account, cld_s_start.SelectedDate, cld_s_end.SelectedDate).ToString(); }
public IActionResult Privacy() { var sellService = new SellService(); sellService.Pay(); return(View("Index")); }
protected void btn_Search_Click(object sender, EventArgs e) { SellService a = new SellService(); GridView1.DataSource = a.searchAllOrder(txtSell_Id.Text); GridView1.DataBind(); }
private void LoadThingByName() { List <SellThing> lstSource = new SellService().SelectSellThingByName(txtFind.Text); this.dgvSellthing.DataSource = lstSource; this.dgvSellthing.AutoGenerateColumns = false; }
private void btnCancel_Click(object sender, EventArgs e) { if (dgvRoomSell.SelectedRows.Count > 0) { if (UIMessageDialog.ShowMessageDialog("你确定要删除该消费记录吗?", UILocalize.WarningTitle, true, Style)) { string time = dgvRoomSell.SelectedRows[0].Cells["clSpendTime"].Value.ToString(); string name = dgvRoomSell.SelectedRows[0].Cells["clSpendName"].Value.ToString(); string price = dgvRoomSell.SelectedRows[0].Cells["clSpendPrice"].Value.ToString(); SellThing s = new SellService().SelectSellThingByNameAndPrice(name, price); decimal num = Convert.ToDecimal(dgvRoomSell.SelectedRows[0].Cells["clSpendAmount"].Value.ToString()); string Stock = (s.Stock + num).ToString(); if (new SellService().DeleteSellThing(txtRoomNo.Text, time) == true) { bool n = new SellService().UpdateSellThing(Stock, s.SellNo); UIMessageTip.ShowOk("撤销成功!", 1000); LoadSpendInfoByRoomNo(txtRoomNo.Text); LoadSellThingInfo(); } } else { UIMessageTip.ShowError("操作取消!", 1000); } } else { MessageBox.Show("请选择要删除的消费记录!", "提示信息"); } }
public void AddTwoNormalProducts() { ConcreteProduct product = new ConcreteProduct() { Name = "My Super Product", Description = "Description of my super product", Weight = 100, Price = 100, Count = 50, Height = 100, Width = 100 }; ConcreteProduct product2 = new ConcreteProduct() { Name = "My Super Product 2", Description = "Description of my super product", Weight = 100, Price = 100, Count = 50, Height = 100, Width = 100 }; SellService sellService = new SellService(this._repository); sellService.AddProduct(product); sellService.AddProduct(product2); Assert.AreEqual(product, this._repository.Get(0)); Assert.AreEqual(product2, this._repository.Get(1)); }
public void AddNormalProductEventsAddCheck() { ConcreteProduct product = new ConcreteProduct() { Name = "My Super Product", Description = "Description of my super product", Weight = 100, Price = 100, Count = 50, Height = 100, Width = 100, }; SellService sellService = new SellService(this._repository); bool isAddCalled = false; bool isAddedCalled = false; sellService.OnAddProduct += (sender, args) => { isAddCalled = true; }; sellService.OnAddedProduct += (sender, args) => { isAddedCalled = true; }; sellService.AddProduct(product); Assert.IsTrue(isAddCalled); Assert.IsTrue(isAddedCalled); Assert.AreEqual(product, this._repository.Get(0)); }
public void LoadSellThingInfo() { List <SellThing> lstSource = new SellService().SelectSellThingAll(); this.dgvSellthing.DataSource = lstSource; this.dgvSellthing.AutoGenerateColumns = false; }
public void SellNormalProductEventCheck() { ConcreteProduct product = new ConcreteProduct() { Name = "My Super Product", Description = "Description of my super product", Weight = 100, Price = 100, Count = 50, Height = 100, Width = 100 }; SellService sellService = new SellService(this._repository); bool isSellChecked = false; bool isSoldChecked = false; sellService.OnSellProduct += (sender, args) => { isSellChecked = true; }; sellService.OnSoldProduct += (sender, args) => { isSoldChecked = true; }; sellService.AddProduct(product); sellService.SellProduct(product); Assert.IsTrue(isSellChecked); Assert.IsTrue(isSoldChecked); Assert.AreEqual((uint)49, this._repository.Get(0).Count); }
protected void Button1_Click(object sender, EventArgs e) { SellService db = new SellService(); seller_Entity a = new seller_Entity(); a.S_account = txtSell_Account.Text; a.S_password = txtSell_password.Text; a.S_name = txtSell_Name.Text; a.S_storeName = txtSell_storename.Text; a.S_tel = txtSell_tel.Text; a.S_question = ddlQuestion.Text; a.S_answer = txtSell_answer.Text; if (!db.exist(txtSell_Account.Text)) { Session["UserAccount"] = a.S_account.Trim(); Session["UserPassword"] = a.S_password.Trim(); Session["Logged"] = true; Session["UserType"] = "1"; db.create(a); Response.Write(MessagesBox.showMessages("注册成功")); System.Web.Security.FormsAuthentication.RedirectFromLoginPage(a.S_account, true); } else { Response.Write(MessagesBox.showMessages("账号已存在,请重新输入")); } }
protected void Button1_Click(object sender, EventArgs e) { SellService a = new SellService(); buyerIntSer b = new buyerIntSer(); if (RadioButtonList1.SelectedItem != null) { if (RadioButtonList1.SelectedItem.Value.ToString() == "卖家") { if (!txtCode.Text.Trim().Equals(lblCode.Text.Trim())) { Response.Write(MessagesBox.showMessages("验证码错误!")); } else { if (a.landing(txtAccount.Text.Trim(), txtPassword.Text.Trim())) { Session["UserAccount"] = txtAccount.Text.Trim(); Session["UserPassword"] = txtPassword.Text.Trim(); Session["Logged"] = true; Session["UserType"] = "1"; System.Web.Security.FormsAuthentication.RedirectFromLoginPage(txtAccount.Text, true); } else { Response.Write(MessagesBox.showMessages("账号或密码错误!")); } } } else { if (!txtCode.Text.Trim().Equals(lblCode.Text.Trim())) { Response.Write(MessagesBox.showMessages("验证码错误!")); } else { if (b.login(txtAccount.Text.Trim(), txtPassword.Text.Trim())) { Session["UserAccount"] = txtAccount.Text.Trim(); Session["UserPassword"] = txtPassword.Text.Trim(); Session["Logged"] = true; Session["UserType"] = "0"; System.Web.Security.FormsAuthentication.RedirectFromLoginPage(txtAccount.Text, true); } else { Response.Write(MessagesBox.showMessages("账号或密码错误!")); } } } } else { Response.Write(MessagesBox.showMessages("请先选择用户角色!")); } }
public void AddInvalidProductNull() { ConcreteProduct product = null; SellService sellService = new SellService(this._repository); sellService.AddProduct(product); }
private void btnDeleteSellThing_Click(object sender, EventArgs e) { bool n = new SellService().DeleteSellThingBySellNo(txtSellNo.Text.Trim()); MessageBox.Show("删除商品成功!"); foreach (Control c in pnlSellThingInfo.Controls) { if (c is TextBox) { c.Text = ""; } } }
private void btnAddSellThing_Click(object sender, EventArgs e) { st = new SellThing() { SellNo = txtSellNo.Text, SellName = txtSellName.Text, SellPrice = Convert.ToDecimal(txtSellPrice.Text), format = Convert.ToString(txtformat.Text), Stock = Convert.ToInt32(txtStock.Text), }; SellThingManager.InsertSellThing(st); MessageBox.Show("添加商品成功"); dgvSellthing.DataSource = SellService.SelectSellThingAll(); }
protected void Button1_Click(object sender, EventArgs e) { SellService a = new SellService(); product_Entity b = new product_Entity(); b.S_account = Session["UserAccount"].ToString().Trim(); b.P_name = txtProduct_name.Text; b.P_category = txtProduct_category.Text; b.P_price = double.Parse(txtProduct_price.Text); b.P_cNum = int.Parse(txtProduct_number.Text); b.P_photo = FileUpload1.FileName; a.add(b, FileUpload1); Response.Write(MessagesBox.showMessages("添加成功")); }
static async Task Main(string[] args) { List <Task> services = new List <Task> { AddService.Main(args), BuyService.Main(args), BuyTriggerService.Main(args), DisplaySummaryService.Main(args), QuoteService.Main(args), SellService.Main(args), SellTriggerService.Main(args) }; await Task.WhenAll(services); }
protected void Page_Load(object sender, EventArgs e) { string account = Session["UserAccount"].ToString(); seller_T seller = new seller_T(); SellService sell = new SellService(); seller = (seller_T)sell.SearchSellinformation(account); lbl_s_account.Text = seller.s_account; lbl_s_name.Text = seller.s_name; lbl_s_profit.Text = seller.s_profit.ToString(); lbl_s_state.Text = seller.s_state?"账号有效":"账号无效"; lbl_s_storename.Text = seller.s_storeName; lbl_s_tel.Text = seller.s_tel; }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); string connectionString = ConfigurationManager .ConnectionStrings["LiteCommerceDB"].ConnectionString; HRService.Init(DatabaseTypes.SQLServer, connectionString); DataService.Init(DatabaseTypes.SQLServer, connectionString); ProductService.Init(DatabaseTypes.SQLServer, connectionString); ReportSercvice.Init(DatabaseTypes.SQLServer, connectionString); SellService.Init(DatabaseTypes.SQLServer, connectionString); }
protected void Button1_Click(object sender, EventArgs e) { if (Session["UserType"].ToString().Trim() == "0") { buyerIntSer buyer = new buyerIntSer(); buyer.Updatepassword(Session["UserAccount"].ToString().Trim(), txtSell_password.Text.Trim()); Response.Write(MessagesBox.showMessages("修改成功!")); Response.Redirect("~/Default.aspx"); } else { SellService a = new SellService(); a.change(Session["UserAccount"].ToString().Trim(), txtSell_password.Text.Trim()); Response.Write(MessagesBox.showMessages("修改成功!")); Response.Redirect("~/Default.aspx"); } }
private void btnAdd_Click(object sender, EventArgs e) { if (rs == 1)//判断房间编号是否可消费 { if (CheckInput()) { SellThing st = new SellService().SelectSellThingByNo(txtSellNo.Text); Room r = new RoomService().SelectRoomByRoomNo(txtRoomNo.Text); Spend s = new Spend() { RoomNo = txtRoomNo.Text, SpendName = txtSellName.Text, SpendAmount = (int)nudNum.Value, CustoNo = r.CustoNo, SpendPrice = Convert.ToDecimal(txtPrice.Text), SpendMoney = Convert.ToDecimal(Convert.ToDouble(txtPrice.Text) * nudNum.Value), SpendTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")), MoneyState = "未结算", }; bool m = new SpendService().InsertSpendInfo(s); if (m == true) { string Stock = (st.Stock - nudNum.Value).ToString(); bool n = new SellService().UpdateSellThing(Stock, st.SellNo); MessageBox.Show("添加成功"); LoadSpendInfoByCustoNo(r.CustoNo); LoadSellThingInfo(); #region 获取添加操作日志所需的信息 OperationLog o = new OperationLog(); o.OperationTime = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd,HH:mm:ss")); o.Operationlog = LoginInfo.WorkerClub + LoginInfo.WorkerPosition + LoginInfo.WorkerName + "于" + DateTime.Now + "帮助" + s.CustoNo + "进行了消费商品:" + txtSellName.Text + "操作!"; o.OperationAccount = LoginInfo.WorkerNo; o.datains_usr = LoginInfo.WorkerNo; o.datains_date = DateTime.Now; #endregion new OperationlogService().InsertOperationLog(o); } else { MessageBox.Show("添加失败"); } } } }
public void DeleteUnExcitedProduct() { ConcreteProduct product = new ConcreteProduct() { Name = "My Super Product", Description = "Description of my super product", Weight = 100, Price = 100, Count = 50, Height = 100, Width = 100 }; SellService sellService = new SellService(this._repository); sellService.AddProduct(product); sellService.DeleteProduct(510); }
public void DeleteNormalProduct() { ConcreteProduct product = new ConcreteProduct() { Name = "My Super Product", Description = "Description of my super product", Weight = 100, Price = 100, Count = 50, Height = 100, Width = 100 }; SellService sellService = new SellService(this._repository); sellService.AddProduct(product); sellService.DeleteProduct(0); Assert.IsNull(this._repository.Get(0)); }
public void UpdateNullProduct() { ConcreteProduct product = new ConcreteProduct() { Name = "My Super Product", Description = "Description of my super product", Weight = 100, Price = 100, Count = 50, Height = 100, Width = 100 }; ConcreteProduct product2 = null; SellService sellService = new SellService(this._repository); sellService.AddProduct(product); sellService.UpdateProduct(product2); }
public void SellNormalProduct() { ConcreteProduct product = new ConcreteProduct() { Name = "My Super Product", Description = "Description of my super product", Weight = 100, Price = 100, Count = 50, Height = 100, Width = 100 }; SellService sellService = new SellService(this._repository); sellService.AddProduct(product); sellService.SellProduct(product); Assert.AreEqual((uint)49, this._repository.Get(0).Count); }
protected void btnSubmit_Click(object sender, EventArgs e) { SellService a = new SellService(); product_Entity b = new product_Entity(); b.P_Id = int.Parse(Request.QueryString["id"].ToString()); b.S_account = Session["UserAccount"].ToString().Trim(); b.P_name = txtProduct_name.Text.Trim(); b.P_category = txtProduct_category.Text.Trim(); b.P_price = double.Parse(txtProduct_price.Text.Trim()); b.P_cNum = int.Parse(txtProduct_number.Text.Trim()); b.P_photo = "~/Images/" + Session["UserAccount"].ToString().Trim() + "/" + FileUpload1.FileName; if (a.updateProInfo(Session["UserAccount"].ToString().Trim(), b, FileUpload1)) { Response.Write(MessagesBox.showMessages("更改成功!")); } else { Response.Write(MessagesBox.showMessages("更改失败!")); } }
protected void btn_submit_Click(object sender, EventArgs e) { SellService db = new SellService(); seller_Entity sell = new seller_Entity(); string account = Session["UserAccount"].ToString().Trim(); sell.S_account = account; sell.S_name = txt_s_name.Text.Trim(); sell.S_storeName = txt_s_storename.Text.Trim(); sell.S_tel = txt_s_tel.Text.Trim(); sell.S_question = ddl_s_question.Text.Trim(); sell.S_answer = txt_s_answer.Text.Trim(); if (db.changeUserInfo(sell)) { Response.Write(MessagesBox.showMessages("用户信息修改成功!")); Response.Redirect("~/Default.aspx"); } else { Response.Write(MessagesBox.showMessages("用户信息修改失败!")); } }
protected void Button1_Click(object sender, EventArgs e) { SellService db = new SellService(); seller_Entity a = new seller_Entity(); a.S_account = txtSell_Account.Text; a.S_password = txtSell_password.Text; a.S_name = txtSell_Name.Text; a.S_storeName = txtSell_storename.Text; a.S_tel = txtSell_tel.Text; a.S_question = ddlQuestion.Text; a.S_answer = txtSell_answer.Text; if (!db.exist(txtSell_Account.Text)) { db.create(a); Response.Write(MessagesBox.showMessages("注册成功")); } else { Response.Write(MessagesBox.showMessages("账号已存在,请重新输入")); } }
public static int InsertSellThing(SellThing st) { return(SellService.InsertSellThing(st)); }
public static SellThing SelectSellInfoBySellNo(string SellNo) { return(SellService.SelectSellInfoBySellNo(SellNo)); }
public static List <SellThing> SelectSellThingAll() { return(SellService.SelectSellThingAll()); }