private void TreeBind(string strWhere) { BLL.Goods goodsBll = new BLL.Goods(); DataTable goodsDT = goodsBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlGoods.Items.Clear(); ddlGoods.Items.Add(new ListItem("承运货物", "")); foreach (DataRow dr in goodsDT.Rows) { this.ddlGoods.Items.Add(new ListItem(dr["Name"].ToString(), dr["Name"].ToString())); } BLL.Customer customerBll = new BLL.Customer(); DataTable customerDT = customerBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlCustomer1.Items.Clear(); ddlCustomer1.Items.Add(new ListItem("托运方", "")); ddlCustomer2.Items.Clear(); ddlCustomer2.Items.Add(new ListItem("收货方", "")); foreach (DataRow dr in customerDT.Rows) { if (!dr["Category"].ToString().Equals("托运方")) { this.ddlCustomer2.Items.Add(new ListItem(dr["ShortName"].ToString(), dr["ShortName"].ToString())); } if (!dr["Category"].ToString().Equals("收货方")) { this.ddlCustomer1.Items.Add(new ListItem(dr["ShortName"].ToString(), dr["ShortName"].ToString())); } } }
private void TreeBind(string strWhere) { BLL.Haulway haulwayBll = new BLL.Haulway(); DataTable haulwayDT = haulwayBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlHaulway.Items.Clear(); ddlHaulway.Items.Add(new ListItem("请选择运输路线", "")); foreach (DataRow dr in haulwayDT.Rows) { this.ddlHaulway.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } BLL.Customer customerBll = new BLL.Customer(); DataTable customerDT = customerBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlShipper.Items.Clear(); ddlShipper.Items.Add(new ListItem("请选择托运方", "")); ddlReceiver.Items.Clear(); ddlReceiver.Items.Add(new ListItem("请选择收货方", "")); foreach (DataRow dr in customerDT.Rows) { if (!dr["Category"].ToString().Equals("托运方")) { this.ddlReceiver.Items.Add(new ListItem(dr["ShortName"].ToString(), dr["Id"].ToString())); } if (!dr["Category"].ToString().Equals("收货方")) { this.ddlShipper.Items.Add(new ListItem(dr["ShortName"].ToString(), dr["Id"].ToString())); } } BLL.Address addressBll = new BLL.Address(); DataTable addressDT = addressBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlLoadingAddress.Items.Clear(); ddlLoadingAddress.Items.Add(new ListItem("请选择装货地址", "")); ddlUnloadingAddress.Items.Clear(); ddlUnloadingAddress.Items.Add(new ListItem("请选择卸货地址", "")); foreach (DataRow dr in addressDT.Rows) { if (!dr["CategoryName"].ToString().Equals("卸货地址")) { this.ddlLoadingAddress.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } if (!dr["CategoryName"].ToString().Equals("装货地址")) { this.ddlUnloadingAddress.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } } BLL.Goods goodsBll = new BLL.Goods(); DataTable goodsDT = goodsBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlGoods.Items.Clear(); ddlGoods.Items.Add(new ListItem("请选择承运货物", "")); foreach (DataRow dr in goodsDT.Rows) { this.ddlGoods.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } }
private void TreeBind(string strWhere) { BLL.Customer customerBLL = new BLL.Customer(); DataTable customerDT = customerBLL.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlCustomer.Items.Clear(); this.ddlCustomer.Items.Add(new ListItem("所属客户", "")); foreach (DataRow dr in customerDT.Rows) { this.ddlCustomer.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } BLL.Goods goodsBLL = new BLL.Goods(); DataTable goodsDT = goodsBLL.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlGoods.Items.Clear(); this.ddlGoods.Items.Add(new ListItem("货物", "")); foreach (DataRow dr in goodsDT.Rows) { this.ddlGoods.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } BLL.Store storeBLL = new BLL.Store(); DataTable storeDT = storeBLL.GetAllList().Tables[0]; storeOptions += "<option value='0'>选择仓库</option>"; foreach (DataRow dr in storeDT.Rows) { storeOptions += "<option value='" + dr["Id"] + "'>" + dr["Name"] + "</option>"; } }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("goods_", DTEnums.ActionEnum.Delete.ToString()); //检查权限 int sucCount = 0; int errorCount = 0; BLL.Goods bll = new BLL.Goods(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { if (bll.Delete(id)) { sucCount += 1; } else { errorCount += 1; } } } AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除货物成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志 JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("goods_list.aspx", "customer_id={0}&store_mode_id={1}&handling_mode_id={2}&keywords={3}", this.customer_id.ToString(), this.store_mode_id.ToString(), this.handling_mode_id.ToString(), this.keywords)); }
private bool DoEdit(int _id) { bool result = false; BLL.Goods bll = new BLL.Goods(); Model.Goods model = bll.GetModel(_id); model.CustomerId = int.Parse(ddlCustomer.SelectedValue); model.StoreModeId = int.Parse(ddlStoreMode.SelectedValue); model.HandlingModeId = int.Parse(ddlHandlingMode.SelectedValue); model.UnitId = int.Parse(ddlUnit.SelectedValue); model.Name = txtName.Text; string[] attributeNames = Request.Form.GetValues("AttributeName"); string[] attributeValues = Request.Form.GetValues("AttributeValue"); string[] attributeRemarks = Request.Form.GetValues("AttributeRemark"); if (attributeNames != null && attributeValues != null && attributeRemarks != null && attributeNames.Length > 0 && attributeValues.Length > 0 && attributeRemarks.Length > 0) { for (int i = 0; i < attributeNames.Length; i++) { model.AddAttributeValues(new GoodsAttributeValues(attributeNames[i], attributeValues[i], attributeRemarks[i])); } } if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改客户信息:" + model.Name); //记录日志 result = true; } return(result); }
private void TreeBind(string strWhere) { BLL.Customer customerBLL = new BLL.Customer(); DataTable customerDT = customerBLL.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlCustomer.Items.Clear(); this.ddlCustomer.Items.Add(new ListItem("客户", "")); foreach (DataRow dr in customerDT.Rows) { this.ddlCustomer.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } BLL.Goods goodsBLL = new BLL.Goods(); DataTable goodsDT = goodsBLL.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlGoods.Items.Clear(); this.ddlGoods.Items.Add(new ListItem("货物", "")); foreach (DataRow dr in goodsDT.Rows) { this.ddlGoods.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } BLL.Vehicle vehicleBLL = new BLL.Vehicle(); DataTable vehicleDT = vehicleBLL.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlVehicle.Items.Clear(); this.ddlVehicle.Items.Add(new ListItem("车辆", "")); foreach (DataRow dr in vehicleDT.Rows) { this.ddlVehicle.Items.Add(new ListItem(dr["PlateNumber"].ToString(), dr["Id"].ToString())); } }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("goods_", DTEnums.ActionEnum.Delete.ToString()); //检查权限 int sucCount = 0; int errorCount = 0; BLL.Goods bll = new BLL.Goods(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { if (bll.Delete(id)) { sucCount += 1; } else { errorCount += 1; } } } AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除货物成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志 JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("goods_list.aspx", "customer_id={0}&store_mode_id={1}&handling_mode_id={2}&keywords={3}", this.customer_id.ToString(), this.store_mode_id.ToString(), this.handling_mode_id.ToString(), this.keywords)); }
private void RptBind(string _strWhere, string _goodsby) { this.page = DTRequest.GetQueryInt("page", 1); if (this.customer_id > 0) { this.ddlCustomer.SelectedValue = this.customer_id.ToString(); } if (this.store_mode_id > 0) { this.ddlStoreMode.SelectedValue = this.store_mode_id.ToString(); } if (this.handling_mode_id > 0) { this.ddlHandlingMode.SelectedValue = this.handling_mode_id.ToString(); } txtKeywords.Text = this.keywords; BLL.Goods bll = new BLL.Goods(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _goodsby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("goods_list.aspx", "customer_id={0}&store_mode_id={1}&handling_mode_id={2}&keywords={3}&page={4}", this.customer_id.ToString(), this.store_mode_id.ToString(), this.handling_mode_id.ToString(), this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private bool DoAdd() { bool result = false; Model.Goods model = new Model.Goods(); BLL.Goods bll = new BLL.Goods(); model.CustomerId = int.Parse(ddlCustomer.SelectedValue); model.StoreModeId = int.Parse(ddlStoreMode.SelectedValue); model.HandlingModeId = int.Parse(ddlHandlingMode.SelectedValue); model.UnitId = int.Parse(ddlUnit.SelectedValue); model.Name = txtName.Text; string[] attributeNames = Request.Form.GetValues("AttributeName"); string[] attributeValues = Request.Form.GetValues("AttributeValue"); string[] attributeRemarks = Request.Form.GetValues("AttributeRemark"); if (attributeNames != null && attributeValues != null && attributeRemarks != null && attributeNames.Length > 0 && attributeValues.Length > 0 && attributeRemarks.Length > 0) { for (int i = 0; i < attributeNames.Length; i++) { model.AddAttributeValues(new GoodsAttributeValues(attributeNames[i], attributeValues[i], attributeRemarks[i])); } } if (bll.Add(model)) { AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加客户:" + model.Name); //记录日志 result = true; } return result; }
private void btSearchRoomGoods_Click(object sender, EventArgs e) { string information = ""; switch (combRoomGoods.Text.Trim()) { case "编号": information = "goodsID"; break; case "名称": information = "goodsName"; break; case "价格": information = "goodsPrice"; break; default: break; } Maticsoft.BLL.Goods go = new BLL.Goods(); string string1 = string.Format("{0} = '{1}'", information, tbRoomGoods.Text.Trim()); DataSet ds = new DataSet(); ds = go.GetList(string1); dgvRoomGoods.DataSource = ds.Tables[0]; ds.Tables[0].Columns["goodsId"].ColumnName = "编号"; ds.Tables[0].Columns["goodsName"].ColumnName = "名称"; ds.Tables[0].Columns["goodsPrice"].ColumnName = "价格"; ds.Tables[0].Columns["roomTypeID"].ColumnName = "房型"; dgvRoomGoods.AllowUserToAddRows = false; dgvRoomGoods.SelectionMode = DataGridViewSelectionMode.FullRowSelect; }
private void ShowInfo(int _id) { BLL.Goods bll = new BLL.Goods(); Model.Goods model = bll.GetModel(_id); txtName.Text = model.Name; txtCategroy.Text = model.CategoryName; txtCode.Text = model.Code; txtUnit.Text = model.Unit; }
private void TreeBind(string strWhere) { BLL.Goods goodsBll = new BLL.Goods(); DataTable goodsDT = goodsBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlGoods.Items.Clear(); ddlGoods.Items.Add(new ListItem("承运货物", "")); foreach (DataRow dr in goodsDT.Rows) { this.ddlGoods.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } BLL.Customer customerBll = new BLL.Customer(); DataTable customerDT = customerBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlCustomer1.Items.Clear(); ddlCustomer1.Items.Add(new ListItem("托运方", "")); ddlCustomer2.Items.Clear(); ddlCustomer2.Items.Add(new ListItem("收货方", "")); foreach (DataRow dr in customerDT.Rows) { if (!dr["Category"].ToString().Equals("托运方")) { this.ddlCustomer2.Items.Add(new ListItem(dr["ShortName"].ToString(), dr["Id"].ToString())); } if (!dr["Category"].ToString().Equals("收货方")) { this.ddlCustomer1.Items.Add(new ListItem(dr["ShortName"].ToString(), dr["Id"].ToString())); } } BLL.Address addressBll = new BLL.Address(); DataTable addressDT = addressBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlLoadingAddress.Items.Clear(); ddlLoadingAddress.Items.Add(new ListItem("请选择装货地址", "")); ddlUnloadingAddress.Items.Clear(); ddlUnloadingAddress.Items.Add(new ListItem("请选择卸货地址", "")); foreach (DataRow dr in addressDT.Rows) { if (!dr["CategoryName"].ToString().Equals("卸货地址")) { this.ddlLoadingAddress.Items.Add(new ListItem(dr["Name"].ToString(), dr["Name"].ToString())); } if (!dr["CategoryName"].ToString().Equals("装货地址")) { this.ddlUnloadingAddress.Items.Add(new ListItem(dr["Name"].ToString(), dr["Name"].ToString())); } } ddlIsAllot.Items.Clear(); ddlIsAllot.Items.Add(new ListItem("是否调拨单", "0")); ddlIsAllot.Items.Add(new ListItem("是", "1")); ddlIsAllot.Items.Add(new ListItem("否", "2")); }
private void pnl_search_Click(object sender, EventArgs e) { IBLL.IGoods bll = new BLL.Goods(); all_list = bll.GetAllClsList(); this.total = all_list.Count; int m = (int)Math.Ceiling((decimal)this.total / (decimal)this.pageSize); this.pageCount = m; this.pnl_first_Click(pnl_first, null); }
private void TreeBind(string strWhere) { BLL.Goods goodsBLL = new BLL.Goods(); DataTable customerDT = goodsBLL.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlGoods.Items.Clear(); this.ddlGoods.Items.Add(new ListItem("货物", "")); foreach (DataRow dr in customerDT.Rows) { this.ddlGoods.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } }
protected void ddlGoods_SelectedIndexChanged(object sender, EventArgs e) { if (!string.IsNullOrEmpty(ddlGoods.SelectedValue)) { BLL.Goods bll = new BLL.Goods(); Model.Goods m = bll.GetModel(Convert.ToInt32(ddlGoods.SelectedValue)); if (m != null) { txtUnit.Text = m.Unit; } } }
private void GoodsBind(int customerId) { BLL.Goods goodsBLL = new BLL.Goods(); DataTable goodsDT = goodsBLL.GetList(0, "CustomerId = " + customerId + "", "Id desc").Tables[0]; this.ddlGoods.Items.Clear(); this.ddlGoods.Items.Add(new ListItem("选择货物", "")); foreach (DataRow dr in goodsDT.Rows) { this.ddlGoods.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } }
protected void ddlGoods_SelectedIndexChanged(object sender, EventArgs e) { if (!string.IsNullOrEmpty(ddlGoods.SelectedValue)) { BLL.Goods bll = new BLL.Goods(); Model.Goods m = bll.GetModel(Convert.ToInt32(ddlGoods.SelectedValue)); if (m != null) { txtUnit.Text = m.Unit; } } }
private void Details(HttpContext context) { //context.Response.ContentType = "application/json"; //int id = DTRequest.GetQueryInt("id"); //if (id < 1) //{ // context.Response.Write("{\"status\": 0, \"msg\": \"无效的ID!\"}"); // return; //} //try //{ // Model.Goods model = new BLL.Goods().GetModel(id); // if (model != null) // { // context.Response.Write("{\"status\": 1, \"msg\": \"获取成功!\", \"name\": \"" + model.Name + "\", \"id\": \"" + model.Id + "\", \"categoryName\": " + model.CategoryName + ", \"unit\": \"" + model.Unit + "\", \"code\": \"" + model.Code + "\"}"); // } // else // { // context.Response.Write("{\"status\": 0, \"msg\": \"记录不存在!\"}"); // } //} //catch //{ // context.Response.Write("{\"status\": 0, \"msg\": \"出现异常!\"}"); // return; //} int id = DTRequest.GetQueryInt("id"); if (id < 1) { context.Response.Write("{\"status\": 0, \"msg\": \"无效的ID!\"}"); return; } try { Model.Goods model = new BLL.Goods().GetModel(id); if (model != null) { context.Response.Write("{\"status\": 1, \"msg\": \"获取成功!\", \"name\": \"" + model.Name + "\", \"id\": \"" + model.Id + "\", \"categoryName\": \"" + model.CategoryName + "\", \"unit\": \"" + model.Unit + "\",\"code\": \"" + model.Code + "\"}"); } else { context.Response.Write("{\"status\": 0, \"msg\": \"记录不存在!\"}"); } } catch { context.Response.Write("{\"status\": 0, \"msg\": \"出现异常!\"}"); return; } }
/// <summary> /// 获得商品详情信息 /// </summary> private void GetGoodsInfo() { BLL.Goods bllgood = new BLL.Goods(); int id = Convert.ToInt32(context.Request.QueryString["id"]); Model.Goods modelgood = bllgood.GetModel(id); string res = string.Empty; if (modelgood != null) { res = js.Serialize(modelgood); } context.Response.Write(res); }
private void Details(HttpContext context) { //context.Response.ContentType = "application/json"; //int id = DTRequest.GetQueryInt("id"); //if (id < 1) //{ // context.Response.Write("{\"status\": 0, \"msg\": \"无效的ID!\"}"); // return; //} //try //{ // Model.Goods model = new BLL.Goods().GetModel(id); // if (model != null) // { // context.Response.Write("{\"status\": 1, \"msg\": \"获取成功!\", \"name\": \"" + model.Name + "\", \"id\": \"" + model.Id + "\", \"categoryName\": " + model.CategoryName + ", \"unit\": \"" + model.Unit + "\", \"code\": \"" + model.Code + "\"}"); // } // else // { // context.Response.Write("{\"status\": 0, \"msg\": \"记录不存在!\"}"); // } //} //catch //{ // context.Response.Write("{\"status\": 0, \"msg\": \"出现异常!\"}"); // return; //} int id = DTRequest.GetQueryInt("id"); if (id < 1) { context.Response.Write("{\"status\": 0, \"msg\": \"无效的ID!\"}"); return; } try { Model.Goods model = new BLL.Goods().GetModel(id); if (model != null) { context.Response.Write("{\"status\": 1, \"msg\": \"获取成功!\", \"name\": \"" + model.Name + "\", \"id\": \"" + model.Id + "\", \"categoryName\": \"" + model.CategoryName + "\", \"unit\": \"" + model.Unit + "\",\"code\": \"" + model.Code + "\"}"); } else { context.Response.Write("{\"status\": 0, \"msg\": \"记录不存在!\"}"); } } catch { context.Response.Write("{\"status\": 0, \"msg\": \"出现异常!\"}"); return; } }
public void RoomGoodsLoad() { Maticsoft.BLL.Goods go = new BLL.Goods(); DataSet ds = new DataSet(); ds = go.GetList(""); dgvRoomGoods.DataSource = ds.Tables[0]; ds.Tables[0].Columns["goodsId"].ColumnName = "编号"; ds.Tables[0].Columns["goodsName"].ColumnName = "名称"; ds.Tables[0].Columns["goodsPrice"].ColumnName = "价格"; ds.Tables[0].Columns["roomTypeID"].ColumnName = "房型"; dgvRoomGoods.AllowUserToAddRows = false; dgvRoomGoods.SelectionMode = DataGridViewSelectionMode.FullRowSelect; }
private void RptBind(string _strWhere, string _orderby) { this.page = DTRequest.GetQueryInt("page", 1); this.txtKeywords.Text = this.keywords; BLL.Goods bll = new BLL.Goods(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("goods_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private void ShowInfo(int _id) { BLL.Goods bll = new BLL.Goods(); Model.Goods model = bll.GetModel(_id); ddlCustomer.SelectedValue = model.CustomerId.ToString(); ddlStoreMode.SelectedValue = model.StoreModeId.ToString(); ddlHandlingMode.SelectedValue = model.HandlingModeId.ToString(); ddlUnit.SelectedValue = model.UnitId.ToString(); txtName.Text = model.Name; BLL.GoodsAttributeValues attributeBLL = new BLL.GoodsAttributeValues(); DataTable attributeDT = attributeBLL.GetList(" GoodsId = " + _id + "").Tables[0]; this.rptAttributeList.DataSource = attributeDT; this.rptAttributeList.DataBind(); }
private bool DoAdd() { bool result = false; Model.Goods model = new Model.Goods(); BLL.Goods bll = new BLL.Goods(); model.Name = txtName.Text.Trim(); model.CategoryName = txtCategroy.Text.Trim(); model.Code = string.IsNullOrEmpty(txtCode.Text.Trim()) ? "" : txtCode.Text.Trim(); model.Unit = txtUnit.Text.Trim(); model.Variety = txtVariety.Text.Trim(); if (bll.Add(model) > 0) { AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加客户:" + model.Name); //记录日志 result = true; } return result; }
private void btConfirm_Click(object sender, EventArgs e) { if (tbID.Text.Trim() == "" || tbRoomType.Text.Trim() == "") { MessageBox.Show("输入信息不完整!", "修改失败", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); flag = 1; } if (flag == 0) { if (tbRoomType.Text.Trim() == "双人间" || tbRoomType.Text.Trim() == "单人间" || tbRoomType.Text.Trim() == "套房") { Maticsoft.BLL.Goods go = new BLL.Goods(); string str1 = string.Format("goodsID = '{0}'", tbID.Text.Trim()); Model.Goods gmodel = new Model.Goods(); if (go.GetRecordCount(str1) > 0) { gmodel.goodsID = tbID.Text.Trim(); gmodel.goodsName = tbName.Text.Trim(); gmodel.goodsPrice = Convert.ToDecimal(tbPrice.Text.Trim()); gmodel.roomTypeID = tbRoomType.Text.Trim(); if (go.Update(gmodel) == true) { MessageBox.Show("修改成功!"); ((Main_Admin)this.Owner).RoomGoodsLoad(); this.DialogResult = DialogResult.OK; this.Close(); } else { MessageBox.Show("修改失败!"); } } else { MessageBox.Show("不存在此物品编号!", "修改失败", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { MessageBox.Show("房型不存在!", "修改失败", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } }
private bool DoAdd() { bool result = false; Model.Goods model = new Model.Goods(); BLL.Goods bll = new BLL.Goods(); model.Name = txtName.Text.Trim(); model.CategoryName = txtCategroy.Text.Trim(); model.Code = string.IsNullOrEmpty(txtCode.Text.Trim()) ? "" : txtCode.Text.Trim(); model.Unit = txtUnit.Text.Trim(); if (bll.Add(model) > 0) { AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加客户:" + model.Name); //记录日志 result = true; } return(result); }
private bool DoEdit(int _id) { bool result = false; BLL.Goods bll = new BLL.Goods(); Model.Goods model = bll.GetModel(_id); model.Name = txtName.Text.Trim(); model.CategoryName = txtCategroy.Text.Trim(); model.Code = string.IsNullOrEmpty(txtCode.Text.Trim()) ? "" : txtCode.Text.Trim(); model.Unit = txtUnit.Text.Trim(); if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改客户信息:" + model.Name); //记录日志 result = true; } return(result); }
private void pnlimg1_Click(object sender, EventArgs e) { try { var f = new OpenFileDialog(); if (f.ShowDialog() == DialogResult.OK) { Image img = Image.FromFile(f.FileName); string str = ""; BLL.IGoods bllg = new BLL.Goods(); bllg.UploadImage(img, out str); pnlimgA.Text = str; pnlimgA.BackgroundImage = img; } } catch (Exception ex) { Program.frmMsg(ex.Message); } }
private void btConfirm_Click(object sender, EventArgs e) { if (tbID.Text.Trim() == "" || tbRoomType.Text.Trim() == "") { MessageBox.Show("输入信息不完整!", "删除失败", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); flag = 1; } if (flag == 0) { if (tbRoomType.Text.Trim() == "双人间" || tbRoomType.Text.Trim() == "单人间" || tbRoomType.Text.Trim() == "套房") { Maticsoft.BLL.Goods go = new BLL.Goods(); string str1 = string.Format("goodsID = '{0}'", tbID.Text.Trim()); string string1 = string.Format("{0}", tbID.Text.Trim()); string str2 = string.Format("{0}", tbRoomType.Text.Trim()); if (go.GetRecordCount(str1) > 0) { if (go.Delete(string1, str2) == true) { MessageBox.Show("删除成功!"); ((Main_Admin)this.Owner).RoomGoodsLoad(); this.DialogResult = DialogResult.OK; this.Close(); } else { MessageBox.Show("删除失败!"); } } else { MessageBox.Show("不存在此物品编号!", "删除失败", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { MessageBox.Show("房型不存在!", "删除失败", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } }
private void init_pnl_theme() { pnl_theme.Controls.Clear(); BLL.IGoods bll = new BLL.Goods(); var lst = bll.GetThemeList(); if (lst != null && lst.Count > 0) { var x = 20; foreach (body.theme item in lst) { CheckBox box = new CheckBox(); box.Text = item.theme_name; box.Tag = item.theme_code; box.Checked = false; box.Font = new Font("SimSun", 12, FontStyle.Regular); box.Location = new Point(x, 20); x = x + box.Size.Width + 20; pnl_theme.Controls.Add(box); } } }
private void TreeBind(string strWhere) { BLL.StoreInOrder storeinOrderBLL = new BLL.StoreInOrder(); DataTable customerDT = storeinOrderBLL.GetList(0, " Status = 2 ", "Id desc").Tables[0]; this.ddlStoreInOrder.Items.Clear(); this.ddlStoreInOrder.Items.Add(new ListItem("所属入库单", "")); foreach (DataRow dr in customerDT.Rows) { this.ddlStoreInOrder.Items.Add(new ListItem(dr["AccountNumber"].ToString(), dr["Id"].ToString())); } BLL.Goods goodsBLL = new BLL.Goods(); DataTable goodsDT = goodsBLL.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlGoods.Items.Clear(); this.ddlGoods.Items.Add(new ListItem("货物", "")); foreach (DataRow dr in goodsDT.Rows) { this.ddlGoods.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } }
private void btn_stop_Click(object sender, EventArgs e) { var row = this.dataGridView1.CurrentRow; if (row != null && row.Tag != null && row.Tag.ToString() != "") { try { var cls_no = row.Tag.ToString(); var item = all_list.FirstOrDefault(d => d.item_clsno == cls_no); item.is_stop = "1"; IBLL.IGoods bll = new BLL.Goods(); bll.StopCls(cls_no); this.pageChanged(); } catch (Exception ex) { Log.writeLog("frmGoodsCls->btn_stop_Click()", ex.ToString(), null); new MsgForm(ex.GetMessage()).ShowDialog(); } } }
private void TreeBind(string strWhere) { BLL.Goods goodsBll = new BLL.Goods(); DataTable goodsDT = goodsBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlGoods.Items.Clear(); ddlGoods.Items.Add(new ListItem("承运货物", "")); foreach (DataRow dr in goodsDT.Rows) { this.ddlGoods.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } BLL.Customer customerBll = new BLL.Customer(); DataTable customerDT = customerBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlCustomer1.Items.Clear(); ddlCustomer1.Items.Add(new ListItem("托运方", "")); ddlCustomer2.Items.Clear(); ddlCustomer2.Items.Add(new ListItem("收货方", "")); foreach (DataRow dr in customerDT.Rows) { if (!dr["Category"].ToString().Equals("托运方")) { this.ddlCustomer2.Items.Add(new ListItem(dr["ShortName"].ToString(), dr["Id"].ToString())); } if (!dr["Category"].ToString().Equals("收货方")) { this.ddlCustomer1.Items.Add(new ListItem(dr["ShortName"].ToString(), dr["Id"].ToString())); } } BLL.Address addressBll = new BLL.Address(); DataTable addressDT = addressBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlLoadingAddress.Items.Clear(); ddlLoadingAddress.Items.Add(new ListItem("请选择装货地址", "")); ddlUnloadingAddress.Items.Clear(); ddlUnloadingAddress.Items.Add(new ListItem("请选择卸货地址", "")); foreach (DataRow dr in addressDT.Rows) { if (!dr["CategoryName"].ToString().Equals("卸货地址")) { this.ddlLoadingAddress.Items.Add(new ListItem(dr["Name"].ToString(), dr["Name"].ToString())); } if (!dr["CategoryName"].ToString().Equals("装货地址")) { this.ddlUnloadingAddress.Items.Add(new ListItem(dr["Name"].ToString(), dr["Name"].ToString())); } } ddlIsAllot.Items.Clear(); ddlIsAllot.Items.Add(new ListItem("是否调拨单", "0")); ddlIsAllot.Items.Add(new ListItem("是", "1")); ddlIsAllot.Items.Add(new ListItem("否", "2")); }
private void TreeBind(string strWhere) { BLL.Customer customerBLL = new BLL.Customer(); DataTable customerDT = customerBLL.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlCustomer.Items.Clear(); this.ddlCustomer.Items.Add(new ListItem("所属客户", "")); foreach (DataRow dr in customerDT.Rows) { this.ddlCustomer.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } BLL.Goods goodsBLL = new BLL.Goods(); DataTable goodsDT = goodsBLL.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlGoods.Items.Clear(); this.ddlGoods.Items.Add(new ListItem("货物", "")); foreach (DataRow dr in goodsDT.Rows) { this.ddlGoods.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } BLL.Store storeBLL = new BLL.Store(); DataTable storeDT = storeBLL.GetAllList().Tables[0]; storeOptions += "<option value='0'>选择仓库</option>"; foreach (DataRow dr in storeDT.Rows) { storeOptions += "<option value='" + dr["Id"] + "'>" + dr["Name"] + "</option>"; } }
private void RptBind(string _strWhere, string _goodsby) { this.page = DTRequest.GetQueryInt("page", 1); if (this.customer_id > 0) { this.ddlCustomer.SelectedValue = this.customer_id.ToString(); } if (this.store_mode_id > 0) { this.ddlStoreMode.SelectedValue = this.store_mode_id.ToString(); } if (this.handling_mode_id > 0) { this.ddlHandlingMode.SelectedValue = this.handling_mode_id.ToString(); } txtKeywords.Text = this.keywords; BLL.Goods bll = new BLL.Goods(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _goodsby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("goods_list.aspx", "customer_id={0}&store_mode_id={1}&handling_mode_id={2}&keywords={3}&page={4}", this.customer_id.ToString(), this.store_mode_id.ToString(), this.handling_mode_id.ToString(), this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private void RptBind(string _strWhere, string _orderby) { this.page = DTRequest.GetQueryInt("page", 1); this.txtKeywords.Text = this.keywords; BLL.Goods bll = new BLL.Goods(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("goods_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
//取重、输入数量 private void inputQty(string text) { if (supcus_no == "") { new MsgForm("未选择客户").ShowDialog(); return; } if (currGoods != null) { if (Program.is_continue_weight == "1" && total_weight == Weight) { new MsgForm("请先放商品,再取重").ShowDialog(); return; } IBLL.ISaleData bll = new BLL.SaleData(); IBLL.IGoods goodsBLL = new BLL.Goods(); Model.bi_t_item_info gd = currGoods; Model.t_order_detail item = new Model.t_order_detail(); item.item_no = gd.item_no; switch (text) { case "取重": if (Program.is_continue_weight == "1" && total_weight != 0) { item.qty = Weight - total_weight; } else { item.qty = Weight; } break; case "手输数量": if (Program.can_input_qty == "1" && currGoods.item_flag == "1") { new MsgForm("称重商品不可手输数量").ShowDialog(); return; } InputNumerForm frm = new InputNumerForm("数量", 3); decimal qty = 0; if (frm.Input(out qty) == true) { if (qty <= 0) { new MsgForm("数量不正确").ShowDialog(); return; } item.qty = qty; } else { return; } break; } if (bll.CheckCusIsRetail(supcus_no)) { item.price = currGoods.base_price;//一级批发价 } else { IBLL.IClientBLL bll2 = new BLL.ClientBLL(); item.price = bll2.GetCusItemPrice(supcus_no, item.item_no); //在线取客户零批价 } total_weight = Weight; item.item_subno = gd.item_subno; item.item_name = gd.item_name; item.unit_no = gd.unit_no; item.amt = item.qty * item.price; item.sheet_no = lblsheet_no.Text; item.oper_id = Program.oper_id; item.oper_date = DateTime.Now; item.jh = Program.jh; item.cost_price = goodsBLL.GetCost(gd.item_no, Program.branch_no); item.branch_no = Program.branch_no; item.cus_no = supcus_no; item.sup_no = supcus_no; item.is_give = "0"; item.source_price = item.price; item.discount = 1; int flow_id = 0; bll.Insert(item, out flow_id); item.flow_id = flow_id; this.lines.Add(item); this.ShowLine(); } }
private void MainForm_Load(object sender, EventArgs e) { frmTop.FormBorderStyle = FormBorderStyle.None; frmTop.WindowState = FormWindowState.Maximized; frmTop.BackColor = Color.FromArgb(30, 110, 165); Label lbl = new Label(); lbl.AutoSize = false; lbl.ForeColor = Color.White; lbl.TextAlign = ContentAlignment.MiddleCenter; lbl.Font = new Font("SimSun", 20); lbl.Text = "正在初始数据……"; lbl.Dock = DockStyle.Fill; frmTop.Controls.Add(lbl); frmTop.Show(); Application.DoEvents(); try { Cursor.Current = Cursors.WaitCursor; IBLL.IGoods goodsBLL = new BLL.Goods(); clsList = goodsBLL.GetClsList(); goodsListAll = goodsBLL.GetList("", ""); foreach (Model.bi_t_item_info item in goodsListAll) { if (String.IsNullOrWhiteSpace(item.item_no)) { continue; } goodsDic.Add(item.item_no, item); } foreach (Model.bi_t_item_cls cls in clsList) { List <Model.bi_t_item_info> lst = new List <Model.bi_t_item_info>(); foreach (Model.bi_t_item_info gd in goodsListAll) { if (gd.item_clsno.Length >= 2 && gd.item_clsno.Substring(0, 2) == cls.item_clsno) { lst.Add(gd); } } clsDic.Add(cls.item_clsno, lst); } if (clsList.Count != 0) { clsDic.TryGetValue(clsList[0].item_clsno, out this.goodsList); } newOrder("销售退货"); ShowBottom(); } catch (Exception ex) { new MsgForm(ex.GetMessage()).ShowDialog(); } finally { Cursor.Current = Cursors.Default; } }
private void TreeBind(string strWhere) { BLL.Haulway haulwayBll = new BLL.Haulway(); DataTable haulwayDT = haulwayBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlHaulway.Items.Clear(); ddlHaulway.Items.Add(new ListItem("请选择运输路线", "")); foreach (DataRow dr in haulwayDT.Rows) { this.ddlHaulway.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } ddlFormula.Items.Clear(); ddlFormula.Items.Add(new ListItem("计量*运费单价", "1")); ddlFormula.Items.Add(new ListItem("计量*公里*运费单价", "2")); ddlFormula.Items.Add(new ListItem("固定运费", "3")); BLL.Customer customerBll = new BLL.Customer(); DataTable customerDT = customerBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlShipper.Items.Clear(); ddlShipper.Items.Add(new ListItem("请选择托运方", "")); ddlReceiver.Items.Clear(); ddlReceiver.Items.Add(new ListItem("请选择收货方", "")); foreach (DataRow dr in customerDT.Rows) { if (!dr["Category"].ToString().Equals("托运方")) { this.ddlReceiver.Items.Add(new ListItem(dr["ShortName"].ToString(), dr["Id"].ToString())); } if (!dr["Category"].ToString().Equals("收货方")) { this.ddlShipper.Items.Add(new ListItem(dr["ShortName"].ToString(), dr["Id"].ToString())); } } BLL.Address addressBll = new BLL.Address(); DataTable addressDT = addressBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlLoadingAddress.Items.Clear(); ddlLoadingAddress.Items.Add(new ListItem("请选择装货地址", "")); ddlUnloadingAddress.Items.Clear(); ddlUnloadingAddress.Items.Add(new ListItem("请选择卸货地址", "")); foreach (DataRow dr in addressDT.Rows) { if (!dr["CategoryName"].ToString().Equals("卸货地址")) { this.ddlLoadingAddress.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } if (!dr["CategoryName"].ToString().Equals("装货地址")) { this.ddlUnloadingAddress.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } } BLL.Goods goodsBll = new BLL.Goods(); DataTable goodsDT = goodsBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlGoods.Items.Clear(); ddlGoods.Items.Add(new ListItem("请选择承运货物", "")); foreach (DataRow dr in goodsDT.Rows) { this.ddlGoods.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } ddlSettleAccountsWay.Items.Clear(); ddlSettleAccountsWay.Items.Add(new ListItem("现结", "现结")); ddlSettleAccountsWay.Items.Add(new ListItem("月结", "月结")); ddlSettleAccountsWay.Items.Add(new ListItem("预付", "预付")); }
private void TreeBind(string strWhere) { BLL.Customer customerBLL = new BLL.Customer(); DataTable customerDT = customerBLL.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlCustomer.Items.Clear(); this.ddlCustomer.Items.Add(new ListItem("客户", "")); foreach (DataRow dr in customerDT.Rows) { this.ddlCustomer.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } BLL.Goods goodsBLL = new BLL.Goods(); DataTable goodsDT = goodsBLL.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlGoods.Items.Clear(); this.ddlGoods.Items.Add(new ListItem("货物", "")); foreach (DataRow dr in goodsDT.Rows) { this.ddlGoods.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } BLL.Vehicle vehicleBLL = new BLL.Vehicle(); DataTable vehicleDT = vehicleBLL.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlVehicle.Items.Clear(); this.ddlVehicle.Items.Add(new ListItem("车辆", "")); foreach (DataRow dr in vehicleDT.Rows) { this.ddlVehicle.Items.Add(new ListItem(dr["PlateNumber"].ToString(), dr["Id"].ToString())); } }
private void TreeBind(string strWhere) { BLL.StoreInOrder storeinOrderBLL = new BLL.StoreInOrder(); DataTable customerDT = storeinOrderBLL.GetList(0, " Status = 2 ", "Id desc").Tables[0]; this.ddlStoreInOrder.Items.Clear(); this.ddlStoreInOrder.Items.Add(new ListItem("所属入库单", "")); foreach (DataRow dr in customerDT.Rows) { this.ddlStoreInOrder.Items.Add(new ListItem(dr["AccountNumber"].ToString(), dr["Id"].ToString())); } BLL.Goods goodsBLL = new BLL.Goods(); DataTable goodsDT = goodsBLL.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlGoods.Items.Clear(); this.ddlGoods.Items.Add(new ListItem("货物", "")); foreach (DataRow dr in goodsDT.Rows) { this.ddlGoods.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } }
private void ShowInfo(int _id) { BLL.Goods bll = new BLL.Goods(); Model.Goods model = bll.GetModel(_id); ddlCustomer.SelectedValue = model.CustomerId.ToString(); ddlStoreMode.SelectedValue = model.StoreModeId.ToString(); ddlHandlingMode.SelectedValue = model.HandlingModeId.ToString(); ddlUnit.SelectedValue = model.UnitId.ToString(); txtName.Text = model.Name; BLL.GoodsAttributeValues attributeBLL = new BLL.GoodsAttributeValues(); DataTable attributeDT = attributeBLL.GetList(" GoodsId = " + _id + "").Tables[0]; this.rptAttributeList.DataSource = attributeDT; this.rptAttributeList.DataBind(); }
private void TreeBind(string strWhere) { BLL.Haulway haulwayBll = new BLL.Haulway(); DataTable haulwayDT = haulwayBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlHaulway.Items.Clear(); ddlHaulway.Items.Add(new ListItem("请选择运输路线", "")); foreach (DataRow dr in haulwayDT.Rows) { this.ddlHaulway.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } BLL.Customer customerBll = new BLL.Customer(); DataTable customerDT = customerBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlShipper.Items.Clear(); ddlShipper.Items.Add(new ListItem("请选择托运方", "")); ddlReceiver.Items.Clear(); ddlReceiver.Items.Add(new ListItem("请选择收货方", "")); foreach (DataRow dr in customerDT.Rows) { if (!dr["Category"].ToString().Equals("托运方")) { this.ddlReceiver.Items.Add(new ListItem(dr["ShortName"].ToString(), dr["Id"].ToString())); } if (!dr["Category"].ToString().Equals("收货方")) { this.ddlShipper.Items.Add(new ListItem(dr["ShortName"].ToString(), dr["Id"].ToString())); } } BLL.Address addressBll = new BLL.Address(); DataTable addressDT = addressBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlLoadingAddress.Items.Clear(); ddlLoadingAddress.Items.Add(new ListItem("请选择装货地址", "")); ddlUnloadingAddress.Items.Clear(); ddlUnloadingAddress.Items.Add(new ListItem("请选择卸货地址", "")); foreach (DataRow dr in addressDT.Rows) { if (!dr["CategoryName"].ToString().Equals("卸货地址")) { this.ddlLoadingAddress.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } if (!dr["CategoryName"].ToString().Equals("装货地址")) { this.ddlUnloadingAddress.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } } BLL.Goods goodsBll = new BLL.Goods(); DataTable goodsDT = goodsBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlGoods.Items.Clear(); ddlGoods.Items.Add(new ListItem("请选择承运货物", "")); foreach (DataRow dr in goodsDT.Rows) { this.ddlGoods.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } BLL.TransportOrder transportOrderBLL = new BLL.TransportOrder(); DataTable transportOrderDT = transportOrderBLL.GetSelectList(0, " A.Status = 0", "Id DESC").Tables[0]; ddlTransportOrder.Items.Clear(); ddlTransportOrder.Items.Add(new ListItem("请选择运输单", "")); foreach (DataRow dr in transportOrderDT.Rows) { this.ddlTransportOrder.Items.Add(new ListItem(string.Format("{0}({1})", dr["CarNumber"].ToString(), dr["Code"].ToString()), dr["Id"].ToString())); } }
private void GoodsBind(int customerId) { BLL.Goods goodsBLL = new BLL.Goods(); DataTable goodsDT = goodsBLL.GetList(0, "CustomerId = " + customerId + "", "Id desc").Tables[0]; this.ddlGoods.Items.Clear(); this.ddlGoods.Items.Add(new ListItem("选择货物", "")); foreach (DataRow dr in goodsDT.Rows) { this.ddlGoods.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } }
private void TreeBind(string strWhere) { BLL.Goods goodsBll = new BLL.Goods(); DataTable goodsDT = goodsBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlGoods.Items.Clear(); ddlGoods.Items.Add(new ListItem("承运货物", "")); foreach (DataRow dr in goodsDT.Rows) { this.ddlGoods.Items.Add(new ListItem(dr["Name"].ToString(), dr["Name"].ToString())); } BLL.Customer customerBll = new BLL.Customer(); DataTable customerDT = customerBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlCustomer1.Items.Clear(); ddlCustomer1.Items.Add(new ListItem("托运方", "")); ddlCustomer2.Items.Clear(); ddlCustomer2.Items.Add(new ListItem("收货方", "")); foreach (DataRow dr in customerDT.Rows) { if (!dr["Category"].ToString().Equals("托运方")) { this.ddlCustomer2.Items.Add(new ListItem(dr["ShortName"].ToString(), dr["ShortName"].ToString())); } if (!dr["Category"].ToString().Equals("收货方")) { this.ddlCustomer1.Items.Add(new ListItem(dr["ShortName"].ToString(), dr["ShortName"].ToString())); } } }
private void ShowInfo(int _id) { BLL.Goods bll = new BLL.Goods(); Model.Goods model = bll.GetModel(_id); txtName.Text = model.Name; txtCategroy.Text = model.CategoryName; txtCode.Text = model.Code; txtUnit.Text = model.Unit; txtVariety.Text = model.Variety; }
private bool DoEdit(int _id) { bool result = false; BLL.Goods bll = new BLL.Goods(); Model.Goods model = bll.GetModel(_id); model.Name = txtName.Text.Trim(); model.CategoryName = txtCategroy.Text.Trim(); model.Code = string.IsNullOrEmpty(txtCode.Text.Trim()) ? "" : txtCode.Text.Trim(); model.Unit = txtUnit.Text.Trim(); model.Variety = txtVariety.Text.Trim(); if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改客户信息:" + model.Name); //记录日志 result = true; } return result; }