protected void Page_Load(object sender, EventArgs e) { if (!SOSOshop.BLL.PowerPass.isPass("001009007")) { SOSOshop.BLL.PromptInfo.Popedom("001009001"); } if (!IsPostBack) { ViewState["returnUrl"] = Request.UrlReferrer; HyperLink1.NavigateUrl = Request.UrlReferrer + ""; bool edit = SOSOshop.BLL.PowerPass.isPass("001009004"); this.TextBox2.Enabled = edit; this.TextBox3.Enabled = edit; this.button2.Enabled = edit; this.button3.Enabled = edit; } string sql = string.Format("select *,(select top 1 image from Goods_Image where Goods_ID=product.Goods_ID) as images from product where product_id={0}", Request["pid"]); SOSOshop.BLL.Db db = new SOSOshop.BLL.Db(); //Response.Write(sql); //Response.End(); product = new Productinfo(db.ExecuteTable(sql).Rows[0]); //商品信息 string sqlshop = string.Format("select *," + "(select b.is_cl from product_online_v_1 as b where b.Product_ID= {0}) as is_cl," +//可拆零 "(select b.Price_01 from product_online_v_1 as b where b.Product_ID= {0}) as price_01," + "(select b.Price_02 from product_online_v_1 as b where b.Product_ID= {0}) as price_02," + "isnull((select b.minsell from product_online_v_1 as b where b.Product_ID= {0}),0) as minsell,Product_State," + "case when(select [Stock] from [Product_Stock] as d where d.Product_ID={0}) is null then 0 else 1 end as stock " + "from product where product_id={0}", Request["pid"]); var dt = db.ExecuteTable(sqlshop); shop = new ShopInfo(dt.Rows[0]); if (!IsPostBack) { this.txtId.Value = shop.ID.ToString(); TextBox1.Text = shop.ProductName; TextBox2.Text = shop.SellingPoint; TextBox3.Text = shop.Advertisement; DropDowndrug_sensitive1.SelectedValue = dt.Rows[0]["drug_sensitive"].ToString(); Label1.Text = string.Format("{0:f2}", shop.price_01); Label2.Text = string.Format("{0:f2}", shop.price_02); this.DropDownSellType.SelectedValue = shop.sellType.ToString(); } }
/// <summary> /// 获得用户单位信息 /// </summary> /// <param name="id"></param> /// <returns></returns> public static DataRow GetUserWorker(int id) { SOSOshop.BLL.Db db = new SOSOshop.BLL.Db(); string sql = "select id,name from DrugsBase_Enterprise where id = " + id; return(db.ExecuteTable(sql).Rows[0]); }
/// <summary> /// 获得授权单位用户列表 /// </summary> /// <returns></returns> public static DataTable GetUserWorkList() { try { SOSOshop.BLL.Db db = new SOSOshop.BLL.Db(); DataTable dt = db.ExecuteTable("select case when Parents is null or parents='' then CONVERT(varchar,[ParentId]) else CONVERT(varchar,[ParentId])+','+parents end from memberinfo where uid=" + GetUserId()); if (dt != null) { string ids = dt.Rows[0][0].ToString(); string sql = "select id,name from DrugsBase_Enterprise where id in (" + ids + ") "; return(db.ExecuteTable(sql)); } } catch { } return(null); }
/// <summary> /// 取商品广告位里的商品名称 /// </summary> /// <param name="pid">商品ID列表</param> /// <param name="code">广告位编码</param> /// <returns></returns> protected string GetProductName(List <int> pid, string code) { if (pid.Count > 0) { SOSOshop.BLL.Db db = new SOSOshop.BLL.Db(); DataTable dt = db.ExecuteTable("select Product_Name,product_id from product where product_id in(" + string.Join(",", pid) + ")"); List <string> pname = new List <string>(); dt.AsEnumerable().ToList().ForEach(x => pname.Add(string.Format("<span onmouseover=\"shows(this,{0},'{1}')\">{2}</span>", x.Field <int>("product_id"), code, x.Field <string>("product_name")))); return(pname.Count == 0 ? "" : string.Join("、", pname)); } else { return(""); } }
public string page() { param = "&shopname=" + Request["shopname"]; param += "&changjia=" + Request["changjia"]; param += "&pihao=" + Request["pihao"]; param += "&Price=" + Request["Price"]; param += "&is_cl=" + Request["is_cl"]; param += "&bStock=" + Request["bStock"]; param += "&bShelves=" + Request["bShelves"]; param += "&bGoodsImage=" + Request["bGoodsImage"]; SOSOshop.BLL.Db db = new SOSOshop.BLL.Db(); string sql = "select count(a.product_name) as c" + getFrom() + (where.Length > 1 ? " where 1=1 " + where + "" : ""); //Response.Write(sql); int recordcount = (int)db.ExecuteTable(sql).Rows[0]["c"]; double cs = (int)recordcount / pagesize; //页总数 pagecount = int.Parse(Math.Ceiling(cs).ToString()); System.Text.StringBuilder s = new System.Text.StringBuilder(); s.Append("共<span style='color: Red'>" + recordcount + "</span>条记录"); s.Append("<a href=\"?current=1" + param + "\">"); s.Append("<<"); s.Append("</a> "); int j, i; j = i = 0; if (pageindex > 5) { i = pageindex - 5; j = i; } for (; i < j + 9 && i <= pagecount; i++) { s.Append("<a href=\"?current=" + (i + 1) + param + "\">"); s.Append(i + 1); s.Append("</a> "); } s.Append("<a href=\"?current=" + pagecount + param + "\">"); s.Append(">>"); s.Append("</a> "); return(s.ToString()); }
public Dictionary <string, decimal> GetModel(int productId) { string key = "hl_p_" + productId; Dictionary <string, decimal> price = mc.Get(key) as Dictionary <string, decimal>; if (price == null) { price = new Dictionary <string, decimal>(); bll.ChangeDataCenter(); string sql = string.Format("SELECT a.category,a.Price_N FROM dbo.Price a INNER JOIN dbo.Product_DEF b ON a.ID=b.Product_id AND a.iden=b.iden WHERE b.id='{0}'", productId); var dt = bll.ExecuteTable(sql); foreach (DataRow item in dt.Rows) { price.Add(item["category"].ToString(), (decimal)item["Price_N"]); } mc.Set("hl_p_" + productId, price, DateTime.Now.AddYears(1)); } return(price); }
public static UserAddressModel GetUserAddress(int id) { try { string sql = "select [id],[uid],[username] ,[mobile],[phone] ," + "(select CityName from [yxs_provinces] where id=province) as province," + "(select CityName from [yxs_provinces] where id=city) as city," + "(select CityName from [yxs_provinces] where id=Borough) as borough," + "[address],[zip],[email],[constructionsigns],[consignestime],[stat] from memberreceaddress where id=" + id; SOSOshop.BLL.Db db = new SOSOshop.BLL.Db(); DataTable dt = db.ExecuteTable(sql); UserAddressModel ua = new UserAddressModel(); if (dt != null) { ua.ID = (int)dt.Rows[0]["id"]; ua.Uid = (int)dt.Rows[0]["uid"]; ua.Username = dt.Rows[0]["username"].ToString(); ua.Mobile = dt.Rows[0]["mobile"].ToString(); ua.Phone = dt.Rows[0]["phone"].ToString(); ua.Province = dt.Rows[0]["province"].ToString(); ua.City = dt.Rows[0]["city"].ToString(); ua.Borough = dt.Rows[0]["borough"].ToString(); ua.Address = dt.Rows[0]["address"].ToString(); ua.Zip = dt.Rows[0]["zip"].ToString(); ua.Email = dt.Rows[0]["email"].ToString(); ua.Constructionsigns = dt.Rows[0]["constructionsigns"].ToString(); ua.Consignestime = dt.Rows[0]["consignestime"].ToString(); ua.stat = (Boolean)dt.Rows[0]["stat"]; } return(ua); } catch { } return(null); }
public void LogOnCheck() { //参数提交?act=ExistsUserName if (Request["act"] != null && Request["act"] == "ExistsUserName" && Request["UserName"] != null) { string UserName = Request["UserName"]; Response.Write(IsUserName(UserName) ? 1 : 0); } //参数提交?act=ExistsEMail if (Request["act"] != null && Request["act"] == "ExistsEMail" && Request["Email"] != null) { bool Exists = false; string Email = Request["Email"]; if (!string.IsNullOrEmpty(Email)) { SOSOshop.BLL.Db db = new SOSOshop.BLL.Db(); DataTable dt = db.ExecuteTable(string.Format("select count(uid) from [memberaccount] where Email='{0}'", Email.Trim())); Exists = (int)dt.Rows[0][0] > 0 ? true : false; } Response.Write(Exists ? 1 : 0); } //参数提交?act=ExistsCaptcha if (Request["act"] != null && Request["act"] == "ExistsCaptcha" && Request["Captcha"] != null) { bool Exists = (Request.UserHostAddress.StartsWith("::") || Request.UserHostAddress.StartsWith("192.168") || Request.UserHostAddress.StartsWith("125.69.66"));//如果是局域网,或公司内部就不用验证验证验证码方便自动化测试; string Captcha = Request["Captcha"]; if (!Exists && !string.IsNullOrEmpty(Captcha)) { Exists = (Session["Captcha"] != null && Session["Captcha"].ToString().ToUpper() == Captcha.ToUpper()); } Response.Write(Exists ? 1 : 0); } }
public string page() { param = "&shopname=" + Request["shopname"]; param += "&changjia=" + Request["changjia"]; param += "&pihao=" + Request["pihao"]; param += "&Price=" + Request["Price"]; param += "&is_cl=" + Request["is_cl"]; param += "&sellType=" + Request["sellType"]; param += "&es=" + Request["es"]; param += "&bStock=" + Request["bStock"]; param += "&bShelves=" + Request["bShelves"]; param += "&bGoodsImage=" + Request["bGoodsImage"]; param += "&bMaid=" + Request["bMaid"]; param += "&bGgy=" + Request["bGgy"]; param += "&bQtzs=" + Request["bQtzs"]; param += "&bJyQtzs=" + Request["bJyQtzs"]; param += "&bYsJg=" + Request["bYsJg"]; param += "&bYsFl=" + Request["bYsFl"]; param += "&cuxiao=" + Request["cuxiao"]; param += "&bKong=" + Request["bKong"]; param += "&bSms=" + Request["bSms"] + "&bYlyx=" + Request["bYlyx"] + "&bBq1=" + Request["bBq1"] + "&bBq2=" + Request["bBq2"] + "&bBq3=" + Request["bBq3"] + "&bgys=" + Request["bgys"] + "&bjgqj=" + Request["bjgqj"] + "&bjgqj_s=" + Request["bjgqj_s"] + "&bjgqj_e=" + Request["bjgqj_e"] + "&bStock_s=" + Request["bStock_s"] + "&bStock_e=" + Request["bStock_e"]; SOSOshop.BLL.Db db = new SOSOshop.BLL.Db(); string sql = "select count(a.product_name) as c" + getFrom() + (where.Length > 1 ? " where 1=1 " + where + "" : ""); //Response.Write(sql); int recordcount = (int)db.ExecuteTable(sql).Rows[0]["c"]; double cs = (double)recordcount / pagesize; //页总数 pagecount = int.Parse(Math.Ceiling(cs).ToString()); System.Text.StringBuilder s = new System.Text.StringBuilder(); s.Append("共<span style='color: Red'>" + recordcount + "</span>条记录"); s.Append("<a href=\"?current=1" + param + "\">"); s.Append("<<"); s.Append("</a> "); int j, i; j = i = 0; if (pageindex > 5) { i = pageindex - 5; j = i; } for (; i < j + 9 && i < pagecount; i++) { s.Append("<a href=\"?current=" + (i + 1) + param + (pageindex == i + 1 ? "\" style=\"color:Red" : "") + "\">"); s.Append(i + 1); s.Append("</a> "); } s.Append("<a href=\"?current=" + pagecount + param + "\">"); s.Append(">>"); s.Append("</a> "); return(s.ToString()); }
public string show_list() { pagesize = 16; int pi = string.IsNullOrEmpty(Request.QueryString["current"]) ? 1 : int.Parse(Request.QueryString["current"]); pageindex = pi; System.Text.StringBuilder s = new System.Text.StringBuilder(); SOSOshop.BLL.Db db = new SOSOshop.BLL.Db(); string sql = string.Format("select top {0} *," + "ISNULL((SELECT Product_ID FROM product_online_v WHERE Product_ID=a.Product_ID),0)st," +//是否上架(在前台显示) "(select b.Price_01 from product_online_v_1 as b where b.Product_ID= a.Product_ID) as price_01," + "(select b.Price_02 from product_online_v_1 as b where b.Product_ID= a.Product_ID) as price_02," + "(select stock from product_online_v_1 as c where c.Product_ID=a.Product_ID) as stock," + "(select isnull(stock,0) from Stock_Lock as c where c.Product_ID=a.Product_ID) as stock1" + "{1} WHERE (a.Product_ID NOT IN(SELECT TOP ({0} * ({2} - 1)) a.Product_ID {1} {3} order by a.Product_ID desc)) {4} order by a.Product_ID desc", pagesize, getFrom(), pageindex, where.Length > 1 ? " where 1=1 " + where : "", where); //Response.Write(sql); //Response.End(); SOSOshop.BLL.MongoHelper <MongoDB.Bson.BsonDocument> dbM = new SOSOshop.BLL.MongoHelper <MongoDB.Bson.BsonDocument>("Config"); dbM.ChangeDB("datasynchronism"); var cli = dbM._mongoCollection.FindAll(); DataTable dt = db.ExecuteTable(sql); foreach (DataRow item in dt.Rows) { s.Append("<tr>"); s.Append(table(item["Product_ID"])); s.Append(table("<a title='" + item["created"] + "'>" + item["Product_Name"] + "</a>")); var Specification = Public.GetSpecificationAndS(item) + "x" + item["Goods_Pcs"]; s.Append("<td title='规格:" + Specification + " 剂型:" + item["DrugsBase_Formulation"] + "'><div class='textOverFlow'>" + Specification + "<div></td>");//+ +item["DrugsBase_Specification"].ToString() + "x" + item["Goods_ConveRatio"].ToString() + "x" + item["Goods_Pcs"].ToString() + "</td>"); s.Append(table(item["DrugsBase_ApprovalNumber"])); s.Append(table(item["DrugsBase_Manufacturer"])); decimal Price_01 = 0; decimal.TryParse(Convert.ToString(item["Price_01"]), out Price_01); s.Append(table(string.Format("{0:f2}", Price_01))); decimal Price_02 = 0; decimal.TryParse(Convert.ToString(item["Price_02"]), out Price_02); s.Append(table(string.Format("{0:f2}", Price_02))); if (!Library.Lang.DataValidator.isNumber(item["stock"])) { item["stock"] = 0; } if (!Library.Lang.DataValidator.isNumber(item["stock1"])) { item["stock1"] = 0; } s.Append(table(string.Format("<a title='库存:{1},锁库:{2}'>{0}</a>", int.Parse(item["stock"].ToString()) - int.Parse(item["stock1"].ToString()), item["stock"], item["stock1"]))); s.Append(table(_101shop.Common.SellType.GetType(int.Parse(item["sellType"].ToString())))); //s.Append(table(Convert.ToString(item["is_cl"]).Trim() == "" ? "否" : Convert.ToString(item["is_cl"]).Trim()));//可拆零 //非停用药品处理上下架操作 string disabled = ""; if ((int)item["st"] == 0) { if ((int)item["Product_bShelves"] == 0) { s.Append(table("下架")); } else { if ((int)item["Product_bShelves"] == -1) { s.Append(table("暂不上架")); } else { s.Append(table("待上架")); disabled = "disabled"; } } } else { s.Append(table("上架")); } s.Append(table("<a href='javascript:putad(" + item["product_id"] + ")'>放入广告位</a>")); s.Append("</tr>"); } return(s.ToString()); }
public string show_list() { pagesize = 1000; int pi = string.IsNullOrEmpty(Request.QueryString["current"]) ? 1 : int.Parse(Request.QueryString["current"]); pageindex = pi; System.Text.StringBuilder s = new System.Text.StringBuilder(); SOSOshop.BLL.Db db = new SOSOshop.BLL.Db(); string sql = string.Format("select *," + "(SELECT top 1 fullPath FROM dbo.Tag_PharmAttribute WHERE id IN (SELECT Tag_PharmAttribute_id FROM dbo.Tag_PharmProduct WHERE product_id=a.DrugsBase_ID AND Tag_PharmAttribute_id IN (SELECT id FROM dbo.Tag_PharmAttribute WHERE tag_id=69)))fullPath," + "(select count(*) from [exchange].[dbo].[LinkRegionBidPricing]a1 where a1.goods_id=a.goods_id) as 中标," + "(select count(*) from [exchange].[dbo].[LinkRegionLimitPricing]b1 where b1.goods_id=a.goods_id) as 挂网," + "(select p2.cgy from dbo.spzl p1 inner join dbo.spzl_jg p2 on p1.spid=p2.spid AND p1.sx1=p2.jigid and p1.spid=a.spid) as cgy," + //采购员 //"(select b.is_cl from product_online_v_1 as b where b.Product_ID= a.Product_ID) as is_cl," +//可拆零 "(select b.Price_01 from product_online_v_1 as b where b.Product_ID= a.Product_ID) as price_01," + "(select b.Price_02 from product_online_v_1 as b where b.Product_ID= a.Product_ID) as price_02," + "ISNULL((SELECT Product_ID FROM product_online_v WHERE Product_ID=a.Product_ID),0)st," +//是否上架(在前台显示) "(select stock from product_online_v_1 as c where c.Product_ID=a.Product_ID) as stock," + "(select isnull(stock,0) from Stock_Lock as c where c.Product_ID=a.Product_ID) as stock1," + "(SELECT iden FROM dbo.Product_Centre WHERE product_id=a.Product_ID) iden," + "ISNULL((SELECT 1 FROM DrugsBase_ZYC WHERE DrugsBase_ID=a.DrugsBase_ID),0) is_ZYC," + "(select p2.jigid from dbo.spzl p1 inner join dbo.spzl_jg p2 on p1.spid=p2.spid AND p1.sx1=p2.jigid and p1.spid=a.spid) as es " +//e商 "{1} WHERE (a.Product_ID NOT IN(SELECT TOP ({0} * ({2} - 1)) a.Product_ID {1} {3} order by a.Product_ID desc)) {4} order by a.Product_ID desc", pagesize, getFrom(), pageindex, where.Length > 1 ? " where 1=1 " + where : "", where); DataTable dt = db.ExecuteTable(sql); SOSOshop.BLL.MongoHelper <MongoDB.Bson.BsonDocument> dbM = new SOSOshop.BLL.MongoHelper <MongoDB.Bson.BsonDocument>("Config"); dbM.ChangeDB("datasynchronism"); var cli = dbM._mongoCollection.FindAll(); foreach (DataRow item in dt.Rows) { s.Append("<tr>"); s.Append(table(item["Product_ID"])); s.Append(table(item["Product_Name"])); s.Append("<td>" + Public.GetSpecificationAndS(item) + "x" + item["Goods_Pcs"] + "</td>");//+ +item["DrugsBase_Specification"].ToString() + "x" + item["Goods_ConveRatio"].ToString() + "x" + item["Goods_Pcs"].ToString() + "</td>"); s.Append(table(item["DrugsBase_Formulation"])); s.Append(table(item["DrugsBase_ApprovalNumber"])); s.Append(table(item["DrugsBase_Manufacturer"])); s.Append(table(item["Product_Advertisement"])); s.Append(table(item["Product_SellingPoint"])); decimal Price_01 = 0; decimal.TryParse(Convert.ToString(item["Price_01"]), out Price_01); s.Append(table(string.Format("{0:f2}", Price_01))); decimal Price_02 = 0; decimal.TryParse(Convert.ToString(item["Price_02"]), out Price_02); s.Append(table(string.Format("{0:f2}", Price_02))); if (!Library.Lang.DataValidator.isNumber(item["stock"])) { item["stock"] = 0; } if (!Library.Lang.DataValidator.isNumber(item["stock1"])) { item["stock1"] = 0; } s.Append(table(string.Format("<a title='库存:{1},锁库:{2}'>{0}</a>", int.Parse(item["stock"].ToString()) - int.Parse(item["stock1"].ToString()), item["stock"], item["stock1"]))); //e商 s.Append(table(item["es"])); //供货商 string iden = "101"; if (cli.Count() > 0 && !item.IsNull("iden") && Library.Lang.DataValidator.isNumber(item["iden"])) { var idens = cli.Where(x => x["_id"].AsString == item["iden"].ToString()); if (idens.Count() > 0) { iden = idens.First()["_id"].AsString; } } s.Append(table(iden)); if ("1" == Request["bBq1"]) { s.Append(table(0 < (int)item["中标"] ? "中标基本药物" : "调入基本药物")); if (item["fullPath"] != DBNull.Value) { s.Append(table(fullPath((string)item["fullPath"]))); } else { s.Append(table("")); } } s.Append(table(_101shop.Common.SellType.GetType(int.Parse(item["sellType"].ToString())))); //s.Append(table(Convert.ToString(item["is_cl"]).Trim() == "" ? "否" : Convert.ToString(item["is_cl"]).Trim()));//可拆零 s.Append(table(item["cgy"])); if ((int)item["st"] == 0) { if ((int)item["Product_bShelves"] == 0) { s.Append(table("下架")); } else { if ((int)item["Product_bShelves"] == -1) { s.Append(table("暂不上架")); } else { s.Append(table("<a title='单击变更状态为暂不上架' style='' class='dbShelves' href='javascript:ishelves(-1, " + item["Product_id"] + ")'>待上架</a>")); } } } else { s.Append(table("上架")); } s.Append("</tr>"); } string jystr = ""; if ("1" == Request["bBq1"]) { jystr = @" <th scope='col'> 药品属性 </th> <th scope='col'> 基药分类 </th>"; } return(string.Format("<table border='1'><tbody><tr><th>商品编号</th><th>商品名称</th><th>规格(含转换比、件装</th><th>剂型</th><th>批准文号</th>" + "<th>生产厂家</th><th>广告词</th><th>卖点</th><th>批发价</th><th>OTC价</th><th>库存</th><th>e商</th><th>供应商</th>" + jystr + "<th>销售方式</th><th scope=col>采购员</th><th>状态</th></tr></tbody>{0}</table>", s.ToString())); }