/// <summary> /// 完善datatable数据 如果找不到,则显示ID或者value值 /// </summary> /// <param name="dt"></param> /// <returns></returns> DataTable getDataTableExportInfo(DataTable dt) { if (dt == null || dt.Rows.Count == 0) { return(dt); } dt.Columns.Add("序号", typeof(int)); DataTable dtArea = new BLL.Area().GetAllList().Tables[0]; DataTable dtCustomer = new BLL.Customer().GetAllList().Tables[0]; //遍历修改数据 for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["区域"] = CommonHelper.getAreaName(dtArea, dt.Rows[i]["区域"]); dt.Rows[i]["客户名称"] = CommonHelper.getCustomerName(dtCustomer, dt.Rows[i]["客户名称"]); dt.Rows[i]["序号"] = i + 1; } dt.Columns.Remove("id"); dt.Columns.Remove("备注"); dt.Columns.Remove("CreateBy"); dt.Columns.Remove("CreateTime"); dt.Columns.Remove("UpdateBy"); dt.Columns.Remove("UpdateTime"); return(dt); }
/// <summary> /// 完善datatable数据 如果找不到,则显示ID或者value值 /// </summary> /// <param name="dt"></param> /// <returns></returns> DataTable getDataTableExportInfo(DataTable dt) { if (dt == null || dt.Rows.Count == 0) { return(dt); } DataTable dtDepartment = new BLL.Department().GetAllList().Tables[0]; DataTable dtArea = new BLL.Area().GetAllList().Tables[0]; DataTable dtCustomer = new BLL.Customer().GetAllList().Tables[0]; DataTable dtCommonData = new BLL.Common_Data().GetList(" DataType in('站点类型归属','最新状态')").Tables[0]; //遍历修改数据 dt.Columns.Add("序号", typeof(int)); for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["部门"] = CommonHelper.getDepartmentName(dtDepartment, dt.Rows[i]["部门"]); dt.Rows[i]["区域"] = CommonHelper.getAreaName(dtArea, dt.Rows[i]["区域"]); dt.Rows[i]["客户"] = CommonHelper.getCustomerName(dtCustomer, dt.Rows[i]["客户"]); dt.Rows[i]["站点类型归属"] = CommonHelper.getCommonDataText(dtCommonData, "站点类型归属", dt.Rows[i]["站点类型归属"]); dt.Rows[i]["最新状态"] = CommonHelper.getCommonDataText(dtCommonData, "最新状态", dt.Rows[i]["最新状态"]); dt.Rows[i]["序号"] = i + 1; } dt.Columns.Remove("id"); dt.Columns.Remove("Remark"); dt.Columns.Remove("CreateBy"); dt.Columns.Remove("CreateTime"); dt.Columns.Remove("UpdateBy"); dt.Columns.Remove("UpdateTime"); return(dt); }
private string DoAdd(out int cid) { cid = 0; Model.Customer model = new Model.Customer(); BLL.Customer bll = new BLL.Customer(); manager = GetAdminInfo(); model.c_name = txtName.Text.Trim(); model.c_type = (byte)Utils.ObjToInt(ddltype.SelectedValue); model.c_num = txtNum.Text.ToString(); model.c_isUse = cbIsUse.Checked; model.c_remarks = txtRemark.Text.Trim(); model.c_flag = 0; model.c_owner = manager.user_name; model.c_ownerName = manager.real_name; model.c_addDate = DateTime.Now; model.c_business = txtBusinessScope.Text.Trim(); Model.Contacts contact = new Model.Contacts(); contact.co_flag = true; contact.co_name = txtMContact.Text.Trim(); contact.co_number = txtMPhone.Text.Trim(); return(bll.Add(model, contact, manager, out cid)); }
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>"; } }
/// <summary> /// 完善datatable数据 如果找不到,则显示ID或者value值 /// </summary> /// <param name="dt"></param> /// <returns></returns> DataTable getDataTableExportInfo(DataTable dt) { if (dt == null || dt.Rows.Count == 0) { return(dt); } //删除前面的下划线 foreach (DataColumn column in dt.Columns) { string columnName = column.Caption; if (!string.IsNullOrEmpty(columnName) && string.Equals(columnName.Substring(0, 1), "_")) { column.ColumnName = columnName.Substring(1); } } dt.Columns.Add("序号", typeof(int)); DataTable dtArea = new BLL.Area().GetAllList().Tables[0]; DataTable dtCustomer = new BLL.Customer().GetAllList().Tables[0]; //遍历修改数据 for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["区域"] = CommonHelper.getAreaName(dtArea, dt.Rows[i]["区域"]); dt.Rows[i]["客户名称"] = CommonHelper.getCustomerName(dtCustomer, dt.Rows[i]["客户名称"]); dt.Rows[i]["序号"] = i + 1; } dt.Columns.Remove("id"); dt.Columns.Remove("CreateBy"); dt.Columns.Remove("CreateTime"); dt.Columns.Remove("UpdateBy"); dt.Columns.Remove("UpdateTime"); dt.Columns.Remove("IsDeleted"); return(dt); }
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("customer_list", DTEnums.ActionEnum.Delete.ToString()); //检查权限 int sucCount = 0; int errorCount = 0; BLL.Customer bll = new BLL.Customer(); 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("customer_list.aspx", "typeName={0}&categoryName={1}&keywords={2}", _typeName, _categoryName, this.keywords), "Success"); }
/// <summary> /// 检测订单是否符合提交要求 /// </summary> /// <param name="ordersID"></param> /// <param name="customerID"></param> /// <param name="dealerID"></param> /// <returns></returns> public bool CheckSubmitOrders(int ordersID, int customerID, int dealerID) { bool result = true; if (ordersID > 0) { // 是否添加订购车辆 result &= new BLL.DICDomain().GetDemandRecordsCount(ordersID) > 0; if (!result) { return(false); } } // 是否添加客户联系人 result &= new BLL.Customer().GetCustomerContactCount(customerID) > 0; if (!result) { return(false); } // 是否添加经销店联系人 if (dealerID > 0) { result &= new BLL.DealerContact().GetDealerContactCount(dealerID) > 0; } 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.StoreMode storeModeBLL = new BLL.StoreMode(); DataTable storeModeDT = storeModeBLL.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlStoreMode.Items.Clear(); this.ddlStoreMode.Items.Add(new ListItem("存储方式", "")); foreach (DataRow dr in storeModeDT.Rows) { this.ddlStoreMode.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } BLL.HandlingMode handlingModeBLL = new BLL.HandlingMode(); DataTable handlingModeDT = handlingModeBLL.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlHandlingMode.Items.Clear(); this.ddlHandlingMode.Items.Add(new ListItem("装卸方式", "")); foreach (DataRow dr in handlingModeDT.Rows) { this.ddlHandlingMode.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } }
private bool DoAdd() { bool result = false; Model.Customer model = new Model.Customer(); BLL.Customer bll = new BLL.Customer(); model.TypeName = ddlTypeName.SelectedValue; model.ShortName = txtShortName.Text.Trim(); model.FullName = txtFullName.Text.Trim(); model.Category = ddlCategory.SelectedValue; model.Code = string.IsNullOrEmpty(txtCode.Text.Trim()) ? "" : txtCode.Text.Trim(); model.LinkMan = txtLinkMan.Text.Trim(); model.LinkTel = txtLinkTel.Text.Trim(); model.LinkAddress = txtLinkAddress.Text.Trim(); model.MobileNumber = txtMobileNumber.Text.Trim(); model.TaxRegistrationNumber = txtTaxRegistrationNumber.Text.Trim(); model.Remarks = txtRemarks.Text.Trim(); if (bll.Add(model) > 0) { AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加客户:" + model.ShortName); //记录日志 result = true; } return(result); }
private void TreeBind(string strWhere) { BLL.Vehicle goodsBll = new BLL.Vehicle(); DataTable goodsDT = goodsBll.GetList(0, strWhere, "Id desc").Tables[0]; ddlCarNumber.Items.Clear(); ddlCarNumber.Items.Add(new ListItem("车号不限", "")); foreach (DataRow dr in goodsDT.Rows) { this.ddlCarNumber.Items.Add(new ListItem(dr["CarCode"].ToString(), dr["CarCode"].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 Details(HttpContext context) { int id = DTRequest.GetQueryInt("id"); if (id < 1) { context.Response.Write("{\"status\": 0, \"msg\": \"无效的ID!\"}"); return; } try { Model.Customer model = new BLL.Customer().GetModel(id); if (model != null) { context.Response.Write("{\"status\": 1, \"msg\": \"获取成功!\", \"name\": \"" + model.ShortName + "\", \"id\": \"" + model.Id + "\", \"linkMan\": \"" + model.LinkMan + "\", \"linkTel\": \"" + model.LinkTel + "\", \"linkAddress\": \"" + model.LinkAddress + "\", \"code\": \"" + model.Code + "\"}"); } else { context.Response.Write("{\"status\": 0, \"msg\": \"记录不存在!\"}"); } } catch { context.Response.Write("{\"status\": 0, \"msg\": \"出现异常!\"}"); return; } }
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())); } this.ddlGoods.Items.Clear(); this.ddlGoods.Items.Add(new ListItem("选择货物", "")); 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())); } BLL.HandlingMode handlingModeBLL = new BLL.HandlingMode(); DataTable handlingModeDT = handlingModeBLL.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlHandlingMode.Items.Clear(); this.ddlHandlingMode.Items.Add(new ListItem("选择装卸方式", "")); foreach (DataRow dr in handlingModeDT.Rows) { this.ddlHandlingMode.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } }
private string GetCustomerName(int customerId) { Model.Customer customer = new BLL.Customer().GetModel(customerId); if (customer != null) { return(customer.Name); } return(""); }
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")); }
/// <summary> /// 开票 /// </summary> /// <param name="id"></param> /// <param name="status"></param> /// <param name="username"></param> /// <param name="realname"></param> /// <returns></returns> public string confirmInvoice(int id, bool?status, string date, Model.manager adminModel) { if (status.Value && string.IsNullOrEmpty(date)) { return("请填写开票日期"); } Model.invoices model = GetModel(id); if (model == null) { return("数据不存在"); } if (model.inv_isConfirm == status) { return("状态未变更"); } if (model.inv_flag3 != 2) { return("财务审批未通过,不能开票"); } if (!new permission().checkHasPermission(adminModel, "0408")) { return("无权限开票"); } string _content = "发票id:" + id + ",开票状态:" + Common.BusinessDict.invoiceConfirmStatus()[model.inv_isConfirm] + "→<font color='red'>" + Common.BusinessDict.invoiceConfirmStatus()[status] + "</font>,开票日期:" + date; if (dal.confirmInvoice(id, status, ConvertHelper.toDate(date), adminModel.user_name, adminModel.real_name)) { //写日志 Model.business_log log = new Model.business_log(); log.ol_title = "发票开票"; log.ol_oid = model.inv_oid; log.ol_cid = model.inv_cid.Value; log.ol_relateID = id; log.ol_content = _content; new business_log().Add(DTEnums.ActionEnum.Audit.ToString(), log, adminModel.user_name, adminModel.real_name); //信息通知下申请通知人、业务员 if (status.Value) { string replaceContent = new BLL.Customer().GetModel(model.inv_cid.Value).c_name + "," + model.inv_money; string replaceUser = adminModel.user_name + "," + adminModel.real_name; new BLL.selfMessage().AddMessage("开票申请财务已开具", model.inv_personNum, model.inv_personName, replaceContent, replaceUser); //通知业务员 DataSet ds = new BLL.Order().GetPersonList(0, "op_oid='" + model.inv_oid + "' and op_type=1", ""); if (ds != null && ds.Tables[0].Rows.Count > 0) { new BLL.selfMessage().AddMessage("开票申请财务已开具", ds.Tables[0].Rows[0]["op_number"].ToString(), ds.Tables[0].Rows[0]["op_name"].ToString(), replaceContent, replaceUser); } } return(""); } return("操作失败"); }
private void CustomerBind(int StoreInOrderId) { BLL.Customer customerBLL = new BLL.Customer(); Customer customer = customerBLL.GetModelByStoreInOrder(StoreInOrderId); if (customer != null) { hidCustomerId.Value = customer.Id.ToString(); labCustomerName.Text = customer.Name; } }
/// <summary> /// 更新一条数据 /// </summary> public string Update(Model.customerBank model, string content, Model.manager manager) { if (string.IsNullOrEmpty(model.cb_bankName)) { return("请填写银行账户名称"); } if (string.IsNullOrEmpty(model.cb_bankNum)) { return("请填写客户银行账号"); } if (Exists(model.cb_bankNum, model.cb_cid.Value, model.cb_id.Value)) { return("该银行账号已存在"); } if (string.IsNullOrEmpty(model.cb_bank)) { return("请填写开户行"); } if (string.IsNullOrEmpty(model.cb_bankAddress)) { return("请填写开户地址"); } Model.Customer cu = new BLL.Customer().GetModel(model.cb_cid.Value); if (cu == null) { return("客户不存在"); } if (cu.c_flag == 2) { return("客户已经审批通过,不能编辑联系人"); } if (cu.c_owner != manager.user_name && cu.c_ownerName != manager.real_name) { if (!new BLL.permission().checkHasPermission(manager, "0301")) { return("不是客户所属人或无权限修改客户信息"); } } if (dal.Update(model)) { Model.business_log log = new Model.business_log(); log.ol_cid = model.cb_cid.Value; log.ol_relateID = model.cb_id.Value; log.ol_title = "编辑客户银行账号"; log.ol_content = content; log.ol_operateDate = DateTime.Now; log.ol_operaterNum = manager.user_name; log.ol_operaterName = manager.real_name; new business_log().Add(DTEnums.ActionEnum.Edit.ToString(), log, manager.user_name, manager.real_name); return(""); } return("更新失败"); }
public bool PORefNo_Filter(object obj) { try { BLL.Sale SO = obj as BLL.Sale; BLL.Customer S = cmbCustomer.SelectedItem as BLL.Customer; return(SO.CustomerId == S.Id); } catch (Exception ex) { } return(false); }
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())); } }
protected void Page_Load(object sender, EventArgs e) { this.pageSize = GetPageSize(10); //每页数量 oidStr = DTRequest.GetString("oidStr"); _cusName = DTRequest.GetString("txtCusName"); _cid = DTRequest.GetString("hCusId"); _type = DTRequest.GetString("ddltype"); _sign = DTRequest.GetString("ddlsign"); _money1 = DTRequest.GetString("txtMoney1"); _nature = DTRequest.GetString("ddlnature"); _sdate = DTRequest.GetString("txtsDate"); _edate = DTRequest.GetString("txteDate"); _sdate1 = DTRequest.GetString("txtsDate1"); _edate1 = DTRequest.GetString("txteDate1"); _name = DTRequest.GetString("txtName"); _address = DTRequest.GetString("txtAddress"); _sign1 = DTRequest.GetString("ddlsign1"); _money2 = DTRequest.GetString("txtMoney2"); _person1 = DTRequest.GetString("txtPerson1").ToUpper(); _person2 = DTRequest.GetString("txtPerson2").ToUpper(); _person3 = DTRequest.GetString("txtPerson3").ToUpper(); _person4 = DTRequest.GetString("txtPerson4").ToUpper(); _person5 = DTRequest.GetString("txtPerson5").ToUpper(); _oid = DTRequest.GetString("txtOrderID"); _chk = DTRequest.GetString("txtChk"); _status = DTRequest.GetString("ddlstatus"); _lockstatus = DTRequest.GetString("ddllock"); _area = DTRequest.GetString("ddlarea"); _sdate2 = DTRequest.GetString("txtsDate2"); _edate2 = DTRequest.GetString("txteDate2"); _sdate3 = DTRequest.GetString("txtsDate3"); _edate3 = DTRequest.GetString("txteDate3"); manager = GetAdminInfo(); if (!Page.IsPostBack) { if (!string.IsNullOrEmpty(_cid) && _cid != "0") { DataTable dt = new BLL.Customer().GetList(0, "c_id=" + _cid + "", "").Tables[0]; if (dt != null) { labCustomerName.Text = dt.Rows[0]["c_name"].ToString(); labCustomerPhone.Text = dt.Rows[0]["co_number"].ToString(); } RptBind(); } else { JscriptMsg("请先选择应收付对象", ""); return; } } }
/// <summary> /// 获取客户名称 /// </summary> /// <returns></returns> public string GetCustomerName(int customer) { BLL.Customer bllCustomer = new BLL.Customer(); Model.Customer model = bllCustomer.GetModel(customer); if (string.IsNullOrEmpty(model.CompanyName)) { return("--"); } else { return(model.CompanyName); } }
protected void ddlReceiver_SelectedIndexChanged(object sender, EventArgs e) { if (!string.IsNullOrEmpty(ddlReceiver.SelectedValue)) { BLL.Customer bll = new BLL.Customer(); Model.Customer m = bll.GetModel(Convert.ToInt32(ddlReceiver.SelectedValue)); if (m != null) { txtReceiverLinkMan.Text = m.LinkMan; txtReceiverLinkTel.Text = m.LinkTel; } } }
public void RaisePostBackEvent(string eventArgument) { if (eventArgument == "登录") { CustomerEmail = this.Customertx.Text; Password = this.Passwordtx.Text; BLL.Customer bllcustomer = new BLL.Customer(); List <Model.Customer> customerlist = bllcustomer.GetModelList("1=1"); Model.Customer customer = new Model.Customer(); customer.CustomerName = "123"; } }
/// <summary> /// 获取公司名称 /// </summary> /// <param name="customerId"></param> /// <returns></returns> public string GetCompany(int customerId) { BLL.Customer bllCustomer = new BLL.Customer(); Model.Customer model = bllCustomer.GetModel(customerId); if (model.ParentId == 0) { return(model.CompanyName == "" ? "--" : model.CompanyName); } else { return(bllCustomer.GetModel(model.ParentId).CompanyName); } }
/// <summary> /// 更新一条数据 /// </summary> public string Update(Model.Contacts model, Model.manager manager, string content) { if (string.IsNullOrEmpty(model.co_name)) { return("请填写联系人"); } if (string.IsNullOrEmpty(model.co_number)) { return("请填写联系号码"); } Model.Customer cu = new BLL.Customer().GetModel(model.co_cid.Value); if (cu == null) { return("客户不存在"); } if (cu.c_flag == 2) { return("客户已经审批通过,不能编辑联系人"); } if (cu.c_type == 3) { return("内部客户不能编辑"); } if (cu.c_owner != manager.user_name && cu.c_ownerName != manager.real_name) { if (!new BLL.permission().checkHasPermission(manager, "0301")) { return("不是客户所属人或无权限修改客户信息"); } } if (cu.c_type != 2) { string existMsg = Exists(model.co_number, model.co_id.Value); if (!string.IsNullOrEmpty(existMsg)) { return(existMsg); } } if (dal.Update(model)) { Model.business_log log = new Model.business_log(); log.ol_cid = model.co_cid.Value; log.ol_title = "修改客户联系人"; log.ol_content = content; log.ol_operateDate = DateTime.Now; new business_log().Add(DTEnums.ActionEnum.Edit.ToString(), log, manager.user_name, manager.real_name); return(""); } return("修改失败"); }
private void ShowInfo(int _id) { BLL.Customer bll = new BLL.Customer(); Model.Customer model = bll.GetModel(_id); txtCode.Text = model.Code; txtName.Text = model.Name; txtLinkMan.Text = model.LinkMan; txtLinkTel.Text = model.LinkTel; txtLinkAddress.Text = model.LinkAddress; txtEmail.Text = model.Email; txtFax.Text = model.Fax; rblStatus.SelectedValue = model.Status.ToString(); txtRemark.Text = model.Remark; }
/// <summary> /// Foram load event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form_CRUD_Load(object sender, EventArgs e) { try { _customerBll = new BLL.Customer(); mskEnrollmentFee.TextMaskFormat = MaskFormat.IncludeLiterals; mskId.TextMaskFormat = MaskFormat.IncludeLiterals; cboHasChildren.SelectedText = "false"; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
public void RaisePostBackEvent(string eventArgument) { if (eventArgument == "登录") { CustomerEmail = this.Customertx.Text; Password = this.Passwordtx.Text; BLL.Customer bllcustomer = new BLL.Customer(); List<Model.Customer> customerlist = bllcustomer.GetModelList("1=1"); Model.Customer customer = new Model.Customer(); customer.CustomerName = "123"; } }
public void ProcessRequest(HttpContext context) { BLL.CustomerAddress blladdreess = new BLL.CustomerAddress(); BLL.Customer bllCustomer = new BLL.Customer(); BLL.PublicVersion bllVersion = new BLL.PublicVersion(); JsonData jd = new JsonData(); StringBuilder strAddress = new StringBuilder(); StringBuilder strVersion = new StringBuilder(); context.Response.ContentType = "text/plain"; string customerId = context.Request["cid"]; DataSet dsAddress = new DataSet(); Model.Customer model = bllCustomer.GetModel(int.Parse(customerId)); if (model.ParentId == 0) { dsAddress = blladdreess.GetList("StateInfo=1 and CustimerId=" + model.Id); } else { dsAddress = blladdreess.GetList("StateInfo=1 and CustimerId=" + model.ParentId); } strAddress.Append("<option value=''>请选择收货地址</option>"); foreach (DataRow item in dsAddress.Tables[0].Rows) { strAddress.Append("<option value='" + item["Id"].ToString() + "'>" + item["NameInfo"].ToString() + ", " + item["Addressinfo"].ToString() + ", " + item["Phone"].ToString() + "</option>"); } jd["stateInfo"] = 1; jd["strAddress"] = strAddress.ToString(); DataSet dsVersion = bllVersion.GetList("StateInfo=1 and CustomerId=" + customerId); strVersion.Append("<option value=''>请选择客户公版</option>"); foreach (DataRow item in dsVersion.Tables[0].Rows) { strVersion.Append("<option value='" + item["Id"].ToString() + "'>" + item["NameInfo"].ToString() + "</option>"); } jd["strVersion"] = strVersion.ToString(); context.Response.Write(jd.ToJson()); }
private bool DoAdd() { bool result = false; Model.Customer model = new Model.Customer(); BLL.Customer bll = new BLL.Customer(); model.Code = txtCode.Text; model.Name = txtName.Text; model.LinkMan = txtLinkMan.Text; model.LinkTel = txtLinkTel.Text; model.LinkAddress = txtLinkAddress.Text; model.Email = txtEmail.Text; model.Fax = txtFax.Text; model.Status = Convert.ToInt32(rblStatus.SelectedValue); model.Remark = txtRemark.Text; if (bll.Add(model)) { AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加客户:" + model.Name); //记录日志 result = true; } return result; }
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 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.StoreInOrder storeInOrderBLL = new BLL.StoreInOrder(); DataTable storeInOrderDT = storeInOrderBLL.GetList(0, "Status > 1", "Id desc").Tables[0]; this.ddlStoreInOrder.Items.Clear(); this.ddlStoreInOrder.Items.Add(new ListItem("选择入库单", "")); foreach (DataRow dr in storeInOrderDT.Rows) { this.ddlStoreInOrder.Items.Add(new ListItem(dr["AccountNumber"].ToString(), dr["Id"].ToString())); } }
private string GetCustomerName(int customerId) { Model.Customer customer = new BLL.Customer().GetModel(customerId); if (customer != null) { return customer.Name; } return ""; }
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.StoreMode storeModeBLL = new BLL.StoreMode(); DataTable storeModeDT = storeModeBLL.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlStoreMode.Items.Clear(); this.ddlStoreMode.Items.Add(new ListItem("存储方式", "")); foreach (DataRow dr in storeModeDT.Rows) { this.ddlStoreMode.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } BLL.HandlingMode handlingModeBLL = new BLL.HandlingMode(); DataTable handlingModeDT = handlingModeBLL.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlHandlingMode.Items.Clear(); this.ddlHandlingMode.Items.Add(new ListItem("装卸方式", "")); foreach (DataRow dr in handlingModeDT.Rows) { this.ddlHandlingMode.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } BLL.Unit unitBLL = new BLL.Unit(); DataTable unitDT = unitBLL.GetList(0, strWhere, "Id desc").Tables[0]; this.ddlUnit.Items.Clear(); this.ddlUnit.Items.Add(new ListItem("计量单位", "")); foreach (DataRow dr in unitDT.Rows) { this.ddlUnit.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString())); } }