protected void Page_Load(object sender, EventArgs e) { //判断是否登陆,若没有登陆,则跳到登陆页面 if (Session["Usermanager"] == null) { Response.Redirect("~/Login.aspx"); } else { if (!IsPostBack) { //绑定数据 ddlName.DataSource = Customer.GetAllCustomers(); ddlName.DataTextField = "CusName"; ddlName.DataValueField = "Cusid"; ddlName.DataBind(); //获取所有客户信息 allCustomers = Customer.GetAllCustomers(); anpPage.RecordCount = allCustomers.Count; //显示信息 DisplayCustomer(); } } }
//填充业务员下拉列表 private void fillddlcus() { ddlcus.DataSource = customersmanager.GetAllCustomers(); ddlcus.DataTextField = "CusName"; ddlcus.DataValueField = "CusID"; ddlcus.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //绑定数据 ddlName.DataSource = cm.GetAllCustomers(); ddlName.DataTextField = "cusname"; ddlName.DataValueField = "cusid"; ddlName.DataBind(); //如果传过来的值不为空,则为添加操作 if (Request.QueryString["iaeid"] != null) { IAEManagerTB iam = new IAEManagerTB(); //根据传过来的id号获取信息 iam = ia.GetIAEManagerTBById(Convert.ToInt32(Request.QueryString["iaeid"])); //填充页面信息 ddlName.SelectedValue = iam.CusID.ToString(); txtDate.Text = iam.IAEDate.ToString(); txtIaeName.Text = iam.IAEName.ToString(); txtPrice.Text = iam.Price.ToString(); if (iam.ISsettle == "是") { rdoYes.Checked = true; } else { rdoNo.Checked = true; } txtRemark.Text = iam.Remark.ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["Usermanager"] == null) { Response.Redirect("~/Login.aspx"); } else { if (!IsPostBack) { //获取下拉列表公司 ddlConame1.DataSource = ccm.GetAllCarrieCompany(); ddlConame1.DataTextField = "CoName"; ddlConame1.DataValueField = "Cid"; ddlConame1.DataBind(); //获取下拉列表客户 ddlCusName1.DataSource = cm.GetAllCustomers(); ddlCusName1.DataTextField = "CusName"; ddlCusName1.DataValueField = "CusID"; ddlCusName1.DataBind(); //填充gridview allInfo = am.GetAllAcceptTB(); anpPage.RecordCount = allInfo.Count(); Display(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["Usermanager"] == null) { Response.Redirect("~/Login.aspx"); } else { if (!IsPostBack) { //填充DropDownlist控件客户 this.ddlSustomer.DataSource = Customer.GetAllCustomers(); this.ddlSustomer.DataTextField = "CusName"; this.ddlSustomer.DataValueField = "CusID"; ddlSustomer.DataBind(); this.ddlCarrieCompany.DataSource = ca.GetAllCarrieCompany(); this.ddlCarrieCompany.DataTextField = "CoName"; this.ddlCarrieCompany.DataValueField = "Cid"; ddlCarrieCompany.DataBind(); allInfo = DNMan.GetAllDisNoteTB(); anpPage.RecordCount = allInfo.Count; DisPlay(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { allInfo = iam.GetAll(); anpInfo.RecordCount = allInfo.Count(); BindData(); //绑定数据 ddlName.DataSource = cm.GetAllCustomers(); ddlName.DataTextField = "cusname"; ddlName.DataValueField = "cusid"; ddlName.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //绑定数据 ddlName.DataSource = cm.GetAllCustomers(); ddlName.DataTextField = "cusname"; ddlName.DataValueField = "cusid"; ddlName.DataBind(); ddlCompany.DataSource = ccm.GetAllCarrieCompany(); ddlCompany.DataTextField = "coname"; ddlCompany.DataValueField = "cid"; ddlCompany.DataBind(); //如果传过来的值不为空,则为添加操作 if (Request.QueryString["csid"] != null) { CustomerSentTB cst = new CustomerSentTB(); //跟据传过来的id获取信息 cst = csm.GetInfoByid(Convert.ToInt32(Request.QueryString["csid"])); //如果为无头件,则不显示客户姓名和公司姓名 if (cst.cusid == 0) { ddlName.Visible = false; ddlCompany.Visible = false; } else { ddlName.SelectedValue = cst.cusid.ToString(); ddlCompany.SelectedValue = cst.Cid.ToString(); } //填充页面信息 txtRid.Text = cst.Rid.ToString(); txtDes.Text = cst.Destination; txtKilo.Text = cst.Kilo.ToString(); txtPrice.Text = cst.Price.ToString(); txtRemark.Text = cst.Remark; if (cst.IsSet == "是") { rdoYes.Checked = true; } else { rdoNo.Checked = true; } } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["Usermanager"] == null) { Response.Redirect("~/Login.aspx"); } else { if (!IsPostBack) { //窗体加载标签不显示 lblmessage.Visible = false; //填充DropDownlist控件客户 this.ddlCustomer.DataSource = CusMan.GetAllCustomers(); this.ddlCustomer.DataTextField = "CusName"; this.ddlCustomer.DataValueField = "CusID"; ddlCustomer.DataBind(); if (Request.QueryString["CEid"] == null) { txtcount.Text = ""; txtmoney.Text = ""; txtDate.Text = ""; txtRemark.Text = ""; } if (Request.QueryString["CEid"] != null) { int ceid = Convert.ToInt32(Request.QueryString["CEid"]); CustomerSendTB CusSs = Sudd.SelectCustomerSendByCEid(ceid); ddlCustomer.SelectedValue = CusSs.CusID; txtcount.Text = CusSs.ECount.ToString(); txtmoney.Text = CusSs.EAllPrice.ToString(); string isss = CusSs.Issettle; if (isss == "True") { rdoYes.Checked = true; } else { rdoNo.Checked = true; } txtDate.Text = CusSs.EDate.ToString(); txtRemark.Text = CusSs.Remark; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //显示模板 ddlPno.DataSource = cpm.GetAllInfo(); ddlPno.DataTextField = "PNo"; ddlPno.DataValueField = "PNo"; ddlPno.DataBind(); //如果传过来的值是空的,则是添加 if (Request.QueryString["cpid"] == null) { //显示客户 ddlName.DataSource = cm.GetAllCustomers(); ddlName.DataTextField = "CusName"; ddlName.DataValueField = "CusID"; ddlName.DataBind(); //显示公司 ddlCompany.DataSource = ccm.GetAllCarrieCompany(); ddlCompany.DataTextField = "CoName"; ddlCompany.DataValueField = "Cid"; ddlCompany.DataBind(); } //不为空,则为修改 else { //填充页面信息 ddlName.Visible = false; ddlCompany.Visible = false; lblCus.Visible = true; lblCompany.Visible = true; int cpid = Convert.ToInt32(Request.QueryString["cpid"]); CustomerPriceTB cp = new CustomerPriceTB(); cp = cpm.GetInfoById(cpid); ddlName.Visible = false; ddlCompany.Visible = false; lblCus.Text = cp.customer.CusName; lblCompany.Text = cp.carriecomapny.CoName; ddlPno.Text = cp.PNo; txtCpname.Text = cp.CpName; txtRemark.Text = cp.Remark; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { allInfo = cpm.GetAllInfo(); anpPage.RecordCount = allInfo.Count(); DisPlay(); //显示客户 ddlName.DataSource = cm.GetAllCustomers(); ddlName.DataTextField = "CusName"; ddlName.DataValueField = "CusID"; ddlName.DataBind(); //显示公司 ddlCompany.DataSource = ccm.GetAllCarrieCompany(); ddlCompany.DataTextField = "CoName"; ddlCompany.DataValueField = "Cid"; ddlCompany.DataBind(); } }
public static void Main(string[] args) { var customerManager = new CustomersManager(); Console.WriteLine(customerManager.GetCustomerById("NS-77777")); Console.WriteLine("=========================="); //List<Customer> customers = customerManager.GetAllCustomers().ToList(); //customers.ForEach(Console.WriteLine); //Console.WriteLine("=========================="); //customerManager.InsertCustomer("Test-ID2", "Axel", "Stone", 2, "Los Angeles"); customerManager.DeleteCustomerById("Test-ID"); List <Customer> customers = customerManager.GetAllCustomers().ToList(); customers.ForEach(Console.WriteLine); }
protected void Page_Load(object sender, EventArgs e) { if (Session["Usermanager"] == null) { Response.Redirect("~/Login.aspx"); } else { if (!IsPostBack) { //填充DropDownlist控件客户 this.ddlCustomer.DataSource = CusMan.GetAllCustomers(); this.ddlCustomer.DataTextField = "CusName"; this.ddlCustomer.DataValueField = "CusID"; ddlCustomer.DataBind(); allInfo = sss.GetAllCustomerSendTB(); anpInfo.RecordCount = allInfo.Count(); disbind(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["Usermanager"] == null) { //跳转登陆页 Response.Redirect("~/Login.aspx"); } else { if (!IsPostBack) { //下拉显示承运公司 ddlConame.DataSource = ccm.GetAllCarrieCompany(); ddlConame.DataTextField = "CoName"; ddlConame.DataValueField = "Cid"; ddlConame.DataBind(); //下拉显示客户 ddlCusName.DataSource = cm.GetAllCustomers(); ddlCusName.DataTextField = "CusName"; ddlCusName.DataValueField = "CusID"; ddlCusName.DataBind(); //显示查询数据 if (Request.QueryString["aid"] != null) { int aid = Convert.ToInt32(Request.QueryString["aid"]); AcceptTB at = new AcceptTB(); at = am.GetAcceptTBByIds(aid); txtNumbers.Text = at.CSid.ToString(); ddlConame.Text = at.CID.ToString(); ddlCusName.Text = at.CusID.ToString(); txtMoney.Text = at.Price.ToString(); txtDatetime.Text = at.BeginDate.ToString(); txtRemark.Text = at.Remark; } } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["Usermanager"] == null) { Response.Redirect("~/Login.aspx"); } else { if (!IsPostBack) { //窗体加载标签不显示 lblMessage.Visible = false; //填充DropDownlist控件客户 this.ddlCustomer.DataSource = CusMan.GetAllCustomers(); this.ddlCustomer.DataTextField = "CusName"; this.ddlCustomer.DataValueField = "CusID"; ddlCustomer.DataBind(); if (Request.QueryString["DelID"] == null) { txtprice.Text = ""; txtRemar.Text = ""; } //窗体加载传值 if (Request.QueryString["DelID"] != null) { int del = Convert.ToInt32(Request.QueryString["DelID"]); DelGoodMon dels = delMon.GetAllDelGoodsInfoByID(del); ddlCustomer.SelectedValue = dels.CusID; txtprice.Text = dels.DelUnitPrice.ToString(); txtRemar.Text = dels.Remark; } } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["Usermanager"] == null) { Response.Redirect("~/Login.aspx"); } else { if (!IsPostBack) { //填充DropDownlist控件客户 this.ddlCustomer.DataSource = CusMan.GetAllCustomers(); this.ddlCustomer.DataTextField = "CusName"; this.ddlCustomer.DataValueField = "CusID"; ddlCustomer.DataBind(); //填充DropDownlist控件承运公司 this.ddlCompany.DataSource = ComMan.GetAllCarrieCompany(); this.ddlCompany.DataTextField = "CoName"; this.ddlCompany.DataValueField = "Cid"; ddlCompany.DataBind(); //控件窗体加载不显示 lblmessage.Visible = false; lblerror.Visible = false; //判断页面跳转传过来是否有Nid if (Request.QueryString["Nid"] == null) { if (Request.QueryString["rid"] != null) { txtBeginNo.Text = Request.QueryString["rid"]; txtEndNo.Text = Request.QueryString["rid"]; RegisterTB rt = new RegisterTB(); rt = regMan.GetAllRegisterTBByRid(Convert.ToInt64(Request.QueryString["rid"])); ddlCompany.SelectedValue = rt.Cid.ToString(); CarrieCompanyTB cct = new CarrieCompanyTB(); cct = ccm.GetCompanyByid(Convert.ToInt32(ddlCompany.SelectedValue)); txtmoney.Text = cct.Cmoney.ToString(); } else { txtDate.Visible = false; //清空所有的控件 txtBeginNo.Text = ""; txtEndNo.Text = ""; txtmoney.Text = ""; txtDate.Text = ""; txtRemark.Text = ""; } } else { //接受页面穿的值 int Nid = Convert.ToInt32(Request.QueryString["Nid"].ToString()); //实例化实体类 DisNoteTB disno = new DisNoteTB(); //调用方法查询记录 disno = DIsNtMan.GetByNidDisNoteTB(Nid); ddlCustomer.SelectedValue = disno.CusID.ToString(); ddlCompany.SelectedValue = disno.Cid.ToString(); txtBeginNo.Text = disno.BeginNo.ToString(); txtEndNo.Text = disno.EndNo.ToString(); txtDate.Text = disno.Dtime.ToString(); txtmoney.Text = disno.Sum.ToString(); if (disno.IsSet == "是") { rdoNo.Checked = true; } if (disno.IsSet == "否") { rdoNo.Checked = true; } txtRemark.Text = disno.Remark; } } } }
IEnumerable <Customers> GetAllCustomers(int pageNo, CancellationToken ct) { return(_manager.GetAllCustomers().Skip(pageNo * _pageSize).Take(_pageSize).ToList()); }