public static CompanyEntity getById(int companyId) { DataRow dr = DbHelper.ExecuteDataRow("p_Company_getById", companyId); CompanyEntity company = new CompanyEntity(); if (dr != null) { company.CompanyId = companyId; company.CompanyNo = dr["companyNo"].ToString(); company.Soruce = dr["soruce"].ToString(); company.Type = dr["type"].ToString(); company.VipType = dr["vipType"].ToString(); company.Company = dr["company"].ToString(); company.AreaID = Convert.ToInt32( dr["areaID"]); company.Address = dr["address"].ToString(); company.Postcode = dr["postcode"].ToString(); company.Employees = dr["employees"].ToString(); company.Contact = dr["contact"].ToString(); company.IdCard = dr["idCard"].ToString(); company.Location = dr["location"].ToString(); company.Mobile = dr["mobile"].ToString(); company.Phone = dr["phone"].ToString(); company.Fax = dr["fax"].ToString(); company.Email = dr["email"].ToString(); company.PayMethod = dr["payMethod"].ToString(); if (dr["AccountDay"] != DBNull.Value) company.AccountDay = Convert.ToInt32(dr["AccountDay"]); company.Createdt = Convert.ToDateTime(dr["createdt"]); company.IsCheck = Convert.ToBoolean(dr["isCheck"]); if (dr["AdminId"] != DBNull.Value) company.AdminId = Convert.ToInt32(dr["adminId"]); company.Suggest = dr["suggest"].ToString(); if (dr["checkDt"] != DBNull.Value) company.CheckDt = Convert.ToDateTime(dr["checkDt"]); if (dr["buyRange"] != DBNull.Value) company.buyRange = dr["buyRange"].ToString(); company.cooperateType=dr["cooperateType"].ToString(); if (dr["autoPricePercent"] != DBNull.Value) company.autoPricePercent = Convert.ToDecimal(dr["autoPricePercent"]); if (dr["cooperatePercent"] != DBNull.Value) company.cooperatePercent = Convert.ToDecimal(dr["cooperatePercent"]); company.buyerType = dr["buyerType"].ToString(); company.salesperson = dr["salesperson"].ToString(); company.EatPerson = dr["EatPerson"].ToString(); if(dr["score"]!=DBNull.Value) company.Score = Convert.ToInt32(dr["Score"]); if (dr["receiveTime"] != DBNull.Value) company.ReceiveTime = dr["receiveTime"].ToString(); if(dr["enabledWeeklyPrice"]!=DBNull.Value) company.EnabledWeeklyPrice = Convert.ToBoolean(dr["enabledWeeklyPrice"]); company.sellerType = dr["sellertype"].ToString(); company.BusinessNature = dr["businessNature"].ToString(); company.QuotationMode = dr["quotationMode"].ToString(); } return company; }
protected void rpt_list_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "Del") { string infor; int id = Convert.ToInt32(e.CommandArgument); //logic.company.delete(id); CompanyEntity comEnt = new CompanyEntity(); comEnt.CompanyId = id; comEnt.isDel = true; logic.company.updateIsDel(comEnt); rptBind(); infor = "删除成功!"; Library.Script.ClientMsg(infor); } }
protected void lbtn_Save_Click(object sender, EventArgs e) { if (Request.Headers["Accept"] != "*/*") { CompanyEntity cp = new CompanyEntity(); cp.CompanyId = logic.customer.companyId; cp.AreaID = Convert.ToInt32(ddl_Area.SelectedValue); cp.Address = txt_Address.Text; cp.Phone = txt_phone.Value; cp.Fax = txt_fax.Value; cp.Postcode = txt_postCode.Value; cp.EatPerson = txt_eatperson.Value.Trim(); cp.Contact = txt_contact.Value; cp.IdCard = txt_IDCard.Value; cp.Mobile = txt_Mobile.Value; cp.Email = txt_Email.Value; logic.company.updatePartialBuyer(cp); Library.Script.ClientMsg("修改成功!"); } }
protected void lbtn_reg_Click(object sender, EventArgs e) { CompanyEntity cp = new CompanyEntity(); cp.Company = txt_companyName.Value; cp.CompanyNo = ""; cp.Soruce = "2"; cp.Address = txt_Address.Text; cp.AreaID = Convert.ToInt32(ddl_Area.SelectedValue); cp.Contact = txt_contact.Value; cp.Email = txt_Email.Value; cp.EatPerson = txt_eatPerson.Value.Trim(); cp.Fax = txt_fax.Value; cp.Location = txt_location.Value; cp.Mobile = txt_Mobile.Value; cp.Phone = txt_phone.Value; cp.Postcode = txt_postCode.Value; cp.Type = hd_type.Value; cp.IsCheck = false; cp.buyerType = "1";//普通采购商 logic.company.insert(cp); ScriptManager.RegisterStartupScript(this, this.GetType(), "key", "regSuccess();", true); }
// 采购商 protected void btn_Buyer_Save_Click(object sender, EventArgs e) { if (companyId == 0) { if (logic.company.isExistCompanyNo(txtBuyerCompanyNo.Text.Trim())) { Library.Script.ClientMsg("企业编号已存在,请重新输入!"); return; } } #region CompanyEntity companyEntity = new CompanyEntity(); companyEntity.VipType = "1"; companyEntity.Soruce = "1"; companyEntity.Type = "2"; companyEntity.buyerType = hdBuyerType.Value; companyEntity.AdminId = logic.sysAdmin.AdminID; companyEntity.Company = txtBuyerCompanyName.Text; companyEntity.BusinessNature = ddlBuyerNature.SelectedValue; companyEntity.salesperson = ddl_SalesPerson.SelectedValue; companyEntity.CompanyNo = txtBuyerCompanyNo.Text; companyEntity.AreaID = Convert.ToInt32(ddlBuyerArea.SelectedValue); companyEntity.Address = txtBuyerAddress.Text; companyEntity.Phone = txtBuyerPhone.Text; companyEntity.Fax = txtBuyerFax.Text; companyEntity.Postcode = txtBuyerPostCode.Text; companyEntity.EatPerson = txtBuyerEatPerson.Text; companyEntity.Contact = txtBuyerContact.Text; companyEntity.IdCard = txtBuyerIDCard.Text; companyEntity.Mobile = txtBuyerMobile.Text; companyEntity.Email = txtBuyerEmail.Text; companyEntity.PayMethod = ddlBuyerPayMethod.SelectedValue; int accountDay = 0; int.TryParse(txtBuyerPayDay.Text, out accountDay); companyEntity.AccountDay = accountDay; companyEntity.ReceiveTime = ddlBuyerReceiveTime.Text; companyEntity.IsCheck = chxBuyerIsCheck.Checked; companyEntity.Suggest = txtBuyerSuggest.Text; companyEntity.EnabledWeeklyPrice = chkBuyerWeeklyPrice.Checked; companyEntity.QuotationMode = ""; int currentCompanyId = companyId; if (companyId != 0 && type == 2) { string businessNatures = logic.company.getById(companyId).BusinessNature;//修改前保存原有的企业性质 companyEntity.CompanyId = companyId; logic.company.update(companyEntity); logic.company.updateByCheck(companyEntity); if (companyEntity.BusinessNature != businessNatures)//判断该企业性质是否改变 { logic.buyerRange.buyerRangeBycompanyIdBusinessNature(companyId, companyEntity.BusinessNature, businessNatures); Library.Script.ClientMsgUrl("原有采购范围中的商品已与企业性质同步!", "companyList.aspx"); } else { //初始化系统加价体系,针对系统中所有在销售商品 if (companyEntity.IsCheck)//已通过审核 { try { logic.priceStructure.InsertProductAutoAdd(companyEntity.BusinessNature, companyEntity.CompanyId, companyEntity.AdminId); } catch { } } } Library.Script.ClientMsgUrl("保存成功!", "companyList.aspx"); } else { currentCompanyId = logic.company.insert(companyEntity); companyEntity.CompanyId = currentCompanyId; logic.company.updateByCheck(companyEntity); //初始化系统加价体系,针对系统中所有在销售商品 if (companyEntity.IsCheck)//已通过审核 { try { logic.priceStructure.InsertProductAutoAdd(companyEntity.BusinessNature, companyEntity.CompanyId, companyEntity.AdminId); } catch { } } Library.Script.ClientMsgUrl("保存成功!", "companyList.aspx"); } #endregion }
// 供应商 protected void btn_Selller_Save_Click(object sender, EventArgs e) { if (companyId == 0) { if (logic.company.isExistCompanyNo(txtSellerCompanyNo.Text.Trim())) { Library.Script.ClientMsg("企业编号已存在,请重新输入!"); return; } } #region CompanyEntity companyEntity = new CompanyEntity(); companyEntity.Company = txtSellerCompanyName.Text; companyEntity.VipType = "1"; companyEntity.Soruce = "1"; companyEntity.Type = "1"; companyEntity.AdminId = logic.sysAdmin.AdminID; companyEntity.sellerType = ddlSellerType.SelectedValue; companyEntity.BusinessNature = ddlSellerCompanyClass.SelectedValue; companyEntity.buyerType = ""; companyEntity.CompanyNo = txtSellerCompanyNo.Text; companyEntity.AreaID = Convert.ToInt32(ddlSellerArea.SelectedValue); companyEntity.Address = txtSellerAddress.Text; companyEntity.Location = txtSellerLocation.Text; companyEntity.Phone = txtSellerPhone.Text; companyEntity.Fax = txtSellerFax.Text; companyEntity.Postcode = txtSellerPostCode.Text; companyEntity.Contact = txtSellerContact.Text; companyEntity.Mobile = txtSellerMobile.Text; companyEntity.Email = txtSellerEmail.Text; companyEntity.PayMethod = ddlSellerPayMethod.SelectedValue; if (radFloat.Checked) { companyEntity.cooperateType = "1"; } else if (radBranch.Checked) { companyEntity.cooperateType = "2"; } if (radFree.Checked) { companyEntity.QuotationMode = "1"; } else if (radClosed.Checked) { companyEntity.QuotationMode = "2"; } decimal sellerCooperatePercent = 0m; decimal.TryParse(txtSellerCooperatePercent.Text,out sellerCooperatePercent); companyEntity.cooperatePercent = sellerCooperatePercent; companyEntity.IsCheck = chxSellerIsCheck.Checked; companyEntity.Suggest = txtSellerSuggest.Text; int currentCompanyId = companyId; if (!string.IsNullOrEmpty(hdSellerBusinessNatures.Value)) { if (companyId != 0 && type == 1) { companyEntity.CompanyId = companyId; logic.company.update(companyEntity); logic.company.updateByCheck(companyEntity); } else { currentCompanyId = logic.company.insert(companyEntity); companyEntity.CompanyId = currentCompanyId; logic.company.updateByCheck(companyEntity); } logic.company.saveCompanyBusniessNature(logic.sysAdmin.AdminID, currentCompanyId, hdSellerBusinessNatures.Value); Library.Script.ClientMsgUrl("保存成功!", "companyList.aspx"); } #endregion }
public static int insert(CompanyEntity cp) { return Company.insert(cp); }
public static bool updatePartialSeller(CompanyEntity companyInfo) { return Company.updatePartialSeller(companyInfo); }
//删除企业 public static void updateIsDel(CompanyEntity company) { Company.updateIsDel(company); }
//修改审核信息 public static void updateByCheck(CompanyEntity cp) { Company.updateByCheck(cp); }
public static void update(CompanyEntity company) { DbHelper.ExecuteNonQuery("p_Company_update", company.CompanyId, company.CompanyNo, company.Soruce, company.Type, company.VipType, company.Company, company.AreaID, company.Address, company.Postcode, company.Employees, company.Contact, company.IdCard, company.Location, company.Mobile, company.Phone, company.Fax, company.Email, company.PayMethod, company.AccountDay, company.buyRange, company.cooperateType, company.autoPricePercent, company.cooperatePercent, company.buyerType, company.salesperson, company.EatPerson, company.Score, company.ReceiveTime, company.EnabledWeeklyPrice, company.sellerType, company.BusinessNature, company.QuotationMode ); }
public static bool updatePartialSeller(CompanyEntity compnay) { return DbHelper.ExecuteNonQuery("[dbo].[p_Company_UpdatePartial_Seller]", compnay.CompanyId, compnay.AreaID, compnay.Address, compnay.Location, compnay.Phone, compnay.Fax, compnay.Postcode, compnay.Employees, compnay.Contact, compnay.IdCard, compnay.Mobile, compnay.Email); }
public static bool updatePartialBuyer(CompanyEntity companyInfo) { return DbHelper.ExecuteNonQuery("[dbo].[p_Company_UpdatePartial_Buyer]", companyInfo.CompanyId,companyInfo.AreaID,companyInfo.Address, companyInfo.Phone,companyInfo.Fax,companyInfo.Postcode, companyInfo.EatPerson,companyInfo.Contact,companyInfo.IdCard, companyInfo.Mobile,companyInfo.Email); }
//删除企业 public static void updateIsDel(CompanyEntity company) { DbHelper.ExecuteNonQuery("p_Company_updateIsDel", company.CompanyId, company.isDel); }
//修改审核信息 public static void updateByCheck(CompanyEntity company) { DbHelper.ExecuteNonQuery("p_Company_updateByCheck", company.CompanyId, company.IsCheck, company.AdminId, company.Suggest ); }
public static void update(CompanyEntity cp) { Company.update(cp); }
protected void btn_Save_Click(object sender, EventArgs e) { if (companyId == 0) { if (logic.company.isExistCompanyNo(txt_CompanyNo.Text.Trim())) { Library.Script.ClientMsg("企业编号已存在,请重新输入!"); return; } } CompanyEntity cp = new CompanyEntity(); cp.Company = txt_CompanyName.Text; cp.VipType = "1"; cp.Soruce = "1"; cp.Address = txt_Address.Text; cp.AdminId = logic.sysAdmin.AdminID; cp.AreaID = Convert.ToInt32(ddl_Area.SelectedValue); cp.CompanyNo = txt_CompanyNo.Text; cp.Contact = txt_Contact.Text; cp.Email = txt_Email.Text; cp.Fax = txt_Fax.Text; cp.IdCard = txt_IDCard.Text; cp.IsCheck = chx_isCheck.Checked; cp.Location = txt_Location.Text; cp.Mobile = txt_Mobile.Text; cp.PayMethod = ddl_PayMethod.SelectedValue; cp.Phone = txt_Phone.Text; cp.Postcode = txt_PostCode.Text; cp.Suggest = txt_Suggest.Text; cp.Type = hd_type.Value; cp.buyRange = hd_buyRange.Value; cp.buyerType = hd_buyType.Value; cp.salesperson = ddl_SalesPerson.SelectedValue; cp.EatPerson = txt_eatPerson.Text.Trim(); cp.EnabledWeeklyPrice = chkWeeklyPrice.Checked; cp.ReceiveTime = ddl_receiveTime.SelectedValue; if (cp.Type == "1") { cp.cooperateType = hd_cooperateType.Value; cp.ReceiveTime = "7:00"; if (cp.cooperateType == "2") { cp.cooperatePercent = Convert.ToDecimal(txt_cooperatePercent.Text); } } if (cp.Type == "2") { cp.autoPricePercent = Convert.ToDecimal(txtAutoPercent.Text); } if (companyId != 0) { cp.CompanyId = companyId; cp.Score = Convert.ToInt32(lbl_score.Text.Trim()); logic.company.update(cp); logic.company.updateByCheck(cp); } else { cp.Score = cp.Type == "1" ? Convert.ToInt32(hid_initScore.Value.Trim()) : 0; cp.CompanyId = logic.company.insert(cp); logic.company.updateByCheck(cp); } Library.Script.ClientMsgUrl("保存成功!", "myCustomerList.aspx"); }
public static int insert(CompanyEntity company) { return Convert.ToInt32(DbHelper.ExecuteScalar("p_Company_insert", company.CompanyNo, company.Soruce, company.Type, company.VipType, company.Company, company.AreaID, company.Address, company.Postcode, company.Employees, company.Contact, company.IdCard, company.Location, company.Mobile, company.Phone, company.Fax, company.Email, company.PayMethod, company.AccountDay, company.buyRange, company.cooperateType, company.autoPricePercent, company.cooperatePercent, company.buyerType, company.salesperson, company.EatPerson, company.Score, company.ReceiveTime, company.EnabledWeeklyPrice, company.sellerType, company.BusinessNature, company.QuotationMode )); }