/// <summary>
        /// 找回秘密时,给用户发送验证码
        /// </summary>
        /// <returns></returns>
        public string GetSms()
        {
            string ret         = BaseController.Json(-1, "抱歉,当前用户设置的手机号码可能有误或网络繁忙,你可以重新发送短信!");
            string MobilePhone = Request.Form["phone"];

            //判断用户的手机号码是否已经注册过
            if (IsUserName(MobilePhone))
            {
                bool   ok         = false;
                string smsCaptcha = Common.CheckCode.GenerateNumber();
                Session["Captcha"] = smsCaptcha;
                string          url   = "http://" + Request.Url.Host + "/include/ajax.ashx?act=updateMobilePhone&v=" + Guid.NewGuid().ToString();
                var             sms   = new SOSOshop.MSG.Sms();
                SOSOshop.BLL.Db db    = new SOSOshop.BLL.Db();
                object          phone = db.ExecuteScalar("select OfficePhone from yxs_administrators where adminid=(select Editer from memberaccount a inner join memberinfo b on a.UID=b.UID where MobilePhone='" + MobilePhone + "')");
                if (phone == null || phone.ToString().Trim() == "")
                {
                    phone = "028-66321993";
                }
                string SmsMsg = "您的账户安全验证码为:" + smsCaptcha + ",请在页面填写。如非本人操作,请致电您的专属采购顾问" + phone;
                string from   = "系统";
                string to     = MobilePhone;
                ok = SOSOshop.BLL.Sms.SendAndSaveDataBase(MobilePhone, SmsMsg, from, to);
                if (ok)
                {
                    ret = BaseController.Json(0, "ok");
                }
            }
            return(ret);
        }
        /// <summary>
        /// 取消操作
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool QuXiao(int id)
        {
            SOSOshop.Model.AdminInfo adminInfo = SOSOshop.BLL.AdministrorManager.Get();
            string s = string.Format(@"declare @uid int,@Gift_ID int,@Gift_Number decimal,@Integral decimal 
if exists(select * from MemberIntegralGiftExchange where [State]<>0 and [id]={0}) begin 
update MemberIntegralGiftExchange set ontime=getdate(),Editer={1},[State]=0 
where [State]<>0 and [id]={0} 
select @uid = uid, @Gift_ID = Gift_ID, @Gift_Number = Gift_Number from MemberIntegralGiftExchange where [id]={0}
select @Integral = Integral * @Gift_Number from MemberIntegralGift where [id]=@Gift_ID 
update MemberIntegralGift set Number = Number + @Gift_Number where [id]=@Gift_ID
update MemberIntegral set realityIntegral = realityIntegral + @Integral where [uid]=@uid 
end
select @uid,@Integral", id, adminInfo == null ? 0 : adminInfo.AdminId);

            SOSOshop.BLL.Db db = new SOSOshop.BLL.Db();
            DataSet         ds = db.ExecuteDataSet(s);
            bool            ok = ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0 && !ds.Tables[0].Rows[0].IsNull(0);

            if (ok)
            {
                int     uid      = int.Parse(ds.Tables[0].Rows[0][0].ToString());
                decimal integral = decimal.Parse(ds.Tables[0].Rows[0][1].ToString());
                SOSOshop.BLL.Integral.MemberIntegral bll2 = new SOSOshop.BLL.Integral.MemberIntegral();
                bll2.PresentIntegral(uid, Convert.ToInt32(integral), "返还兑换礼品的积分", true);
            }
            return(ok);
        }
Beispiel #3
0
        /// <summary>
        /// 取得会员应该执行的价格类型
        /// </summary>
        /// <returns></returns>
        public static string GetPriceCategory()
        {
            SOSOshop.BLL.Db db  = new SOSOshop.BLL.Db();
            string          sql = "SELECT PriceCategory FROM dbo.memberinfo WHERE UID=" + GetUserId();

            return((string)db.ExecuteScalarForCache(sql));
        }
Beispiel #4
0
        /// <summary>
        /// 取网站配置信息
        /// </summary>
        /// <returns></returns>
        public static WebSiteInfo GetNetSiteInfo()
        {
            //WebSiteInfo wsi = new WebSiteInfo();
            string sql = @"SELECT TOP 1 [id]
                              ,[websitetitle]
                              ,[tel]
                              ,[fax]
                              ,[email]
                              ,[metekey]
                              ,[meteinfo]
                              ,[websitename]
                              ,[usersagreement]
                              ,[websitedomain]
                          FROM [yxs_websetting]";

            SOSOshop.BLL.Db     db   = new SOSOshop.BLL.Db();
            DataTable           dt   = db.ExecuteTableForCache(sql, DateTime.Now.AddDays(1));
            IList <WebSiteInfo> list = dt.AsEnumerable().Select(x =>
                                                                new WebSiteInfo
            {
                NetName     = x.Field <string>("websitename"),
                Domain      = System.Configuration.ConfigurationManager.AppSettings["CompanyDomainName"],
                NetTitle    = x.Field <string>("websitetitle"),
                Phone       = x.Field <string>("tel"),
                Fax         = x.Field <string>("fax"),
                Email       = x.Field <string>("email"),
                Keys        = x.Field <string>("metekey"),
                NetInfo     = x.Field <string>("meteinfo"),
                NetProtocol = x.Field <string>("usersagreement")
            }).ToList();

            return(list[0]);
        }
Beispiel #5
0
        /// <summary>
        /// 资讯列表
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult list(string id = "100")
        {
            //记录总数
            int recordCount = 0;

            //页总数
            int pageCount = 0;

            //页大小
            int pageSize = 12;

            //当前页
            int pageIndex = 1;

            if (!string.IsNullOrEmpty(Request["pageindex"]))
            {
                pageIndex = int.Parse(Request["pageindex"]);
            }
            ViewBag.id = id;
            var       bll = new SOSOshop.BLL.Db();
            DataTable key = bll.ExecuteTableForCache("SELECT Name,Description,MeteKey,MeteDescription FROM dbo.yxs_articlechannel where id=" + Library.Lang.Input.Filter(id));

            if (key.Rows.Count > 0)
            {
                ViewBag.Name            = key.Rows[0]["Name"];
                ViewBag.MeteKey         = key.Rows[0]["MeteKey"];
                ViewBag.MeteDescription = key.Rows[0]["MeteDescription"];
            }
            string where = string.Format(" AND Channel LIKE('{0}%')", Library.Lang.Input.Filter(id));
            DataTable dt = bll.GetListByPage("yxs_article", "id,Title,CreateTime", pageSize, pageIndex, " id desc ", where, out recordCount, out pageCount);
            //定义页面
            PagedList <DataRow> pl = new PagedList <DataRow>(dt.Select(), pageIndex, pageSize, recordCount);

            return(View(pl));
        }
        /// <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]);
        }
        public ActionResult Index(int id)
        {
            SOSOshop.BLL.Db bll = new SOSOshop.BLL.Db();
            ViewBag._101资讯 = bll.ExecuteTableForCache("SELECT TOP 10 Id,Title,Channel FROM dbo.yxs_article WHERE State=1 AND Channel LIKE('102%')");
            string sql = "SELECT Title,SubTitle,KeyWord,Content,Introduction, (SELECT TOP (1) Name FROM yxs_articlechannel WHERE Id = a.Channel) AS Channel FROM dbo.yxs_article a WHERE State=1 AND Id=" + id;

            return(View(bll.ExecuteTableForCache(sql).Rows));
        }
Beispiel #8
0
        public ActionResult Index(int id)
        {
            SOSOshop.BLL.Db bll = new SOSOshop.BLL.Db();
            ViewBag._101资讯 = bll.ExecuteTableForCache("SELECT TOP 10 id,Title FROM dbo.yxs_article WHERE Channel LIKE('100%') and id<>" + id + " ORDER BY id DESC");
            string sql = "SELECT Title,SubTitle,KeyWord,Content,Introduction,CopyFrom,updateTime FROM dbo.yxs_article WHERE id=" + id;

            return(View(bll.ExecuteTableForCache(sql).Rows));
        }
Beispiel #9
0
 /// <summary>
 /// 更新商品浏览次
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public string clickNum(int id)
 {
     if (Request.HttpMethod == "POST")
     {
         SOSOshop.BLL.Db bll = new SOSOshop.BLL.Db();
         bll.ExecuteNonQuery("UPDATE Product SET Product_ClickNum=Product_ClickNum+1 WHERE Product_ID=" + id);
     }
     return("");
 }
        /// <summary>
        /// 已处理操作
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool YiChuli(int id)
        {
            SOSOshop.Model.AdminInfo adminInfo = SOSOshop.BLL.AdministrorManager.Get();
            string s = string.Format(@"update MemberIntegralGiftExchange set ontime=getdate(),Editer={1},[State]=2 where [State]<>0 and [id]={0}",
                                     id, adminInfo == null ? 0 : adminInfo.AdminId);

            SOSOshop.BLL.Db db = new SOSOshop.BLL.Db();
            return(0 < db.ExecuteNonQuery(s));
        }
Beispiel #11
0
        /// <summary>
        /// 取热门搜索列表
        /// </summary>
        /// <returns></returns>
        public static Dictionary <string, string> GetHotSearch()
        {
            string sql = "select top 5 name,linkad from yxs_topsearches where isshow=1 order by [sort]";

            SOSOshop.BLL.Db             db  = new SOSOshop.BLL.Db();
            DataTable                   dt  = db.ExecuteTableForCache(sql, DateTime.Now.AddHours(1));
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic = dt.AsEnumerable().ToDictionary(x => x.Field <string>("name"), x => x.Field <string>("linkad"));
            return(dic);
        }
Beispiel #12
0
        /// <summary>
        /// 取得基药分类
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public string fullPath(string obj)
        {
            var           dt = new SOSOshop.BLL.Db().ExecuteTableForCache("SELECT id,name FROM dbo.Tag_PharmAttribute WHERE tag_id=69");
            List <string> li = new List <string>();

            foreach (var item in obj.Trim('/').Split('/'))
            {
                li.Add(dt.AsEnumerable().Where(x => x.Field <int>("id") == int.Parse(item)).Select(x => x.Field <string>("name")).First());
            }
            return(string.Join("/", li.ToArray()));
        }
Beispiel #13
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");
            string id         = context.Request["pid"];
            string cuprice    = context.Request["cuprice"];
            string discount   = context.Request["discount"];
            string btime      = context.Request["btime"];
            string etime      = context.Request["etime"];
            string maxsell    = context.Request["maxsell"];
            string minsell    = context.Request["minsell"];
            string otcminsell = context.Request["otcminsell"];
            string canel      = context.Request["canel"];

            if (!string.IsNullOrEmpty(id))
            {
                try
                {
                    //用户操作权限审核
                    if (SOSOshop.BLL.PowerPass.isPass("001030000"))
                    {
                        SOSOshop.BLL.Db db = new SOSOshop.BLL.Db();
                        //设置促销
                        string sql = string.Format("update product set cuprice={0},discount={1},maxsell={2},begindate='{3}',enddate='{4}',otcminsell={6},minsell={7} where Product_ID={5}", cuprice, discount, maxsell, btime, etime, id, otcminsell, minsell);
                        //取消促销设置
                        if (!string.IsNullOrEmpty(canel))
                        {
                            sql = string.Format("update product set cuprice=0,discount=0,maxsell=0,minsell=0,otcminsell=0,begindate=null,enddate=null where Product_ID={0}", id);
                        }
                        int       result     = db.ExecuteNonQuery(sql);
                        AdminInfo adminModel = (AdminInfo)SOSOshop.BLL.AdministrorManager.Get();
                        SOSOshop.BLL.Logs.Log.LogAdminAdd(string.Format("设置了促销商品:[{0}][{1}]", id, new SOSOshop.BLL.Db().ExecuteScalar("SELECT Product_Name FROM dbo.Product WHERE Product_ID=" + id), string.IsNullOrEmpty(canel) ? "促销" : "取消促销"), adminModel.AdminId, adminModel.AdminName, 1);
                        //大表同步更新
                        // sql = "";

                        context.Response.Write("{\"state\":" + result + ",\"message\":\"设置完成\"}");
                    }
                    else
                    {
                        context.Response.Write("{\"state\":-1,\"message\":\"对不起!您没有操作权限。\"}");
                    }
                }
                catch (Exception x)
                {
                    context.Response.Write("{\"state\":-1,\"message\":\"" + x.Message + "\"}");
                }
            }
            else
            {
                context.Response.Write("{\"state\":-1,\"message\":\"操作错误!\"}");
            }
        }
        public static string Get_Json(int value)
        {
            string js = "";

            //查询数据库
            try
            {
                SOSOshop.BLL.Db db         = new SOSOshop.BLL.Db();
                StringBuilder   json       = new StringBuilder();
                string          ParentPath = "";
                string          sql        = "SELECT ParentPath FROM Region WHERE (ParentPath <> '') GROUP BY ParentPath ORDER BY ParentPath";
                DataTable       dt         = db.ExecuteTableForCache(sql);
                if (dt != null)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        ParentPath += dr[0] + ":";
                    }
                    if (ParentPath != "")
                    {
                        ParentPath = ParentPath.Substring(0, ParentPath.Length - 1);
                    }

                    string[] Paths = ParentPath.Split(":".ToCharArray());
                    foreach (string Path in Paths)
                    {
                        sql = "select Id,Name,ParentPath from Region where ParentPath='" + Path + "' ORDER BY OrderID";
                        dt  = db.ExecuteTableForCache(sql);
                        if (dt != null)
                        {
                            json.Append("'" + Path + "':{");
                            string option = "";
                            foreach (DataRow dr in dt.Rows)
                            {
                                option += dr["Id"].ToString() + ":'" + dr["Name"].ToString().Trim("\r\n '".ToCharArray()) + "',";
                            }
                            if (option != "")
                            {
                                json.Append(option.Substring(0, option.Length - 1) + "},");
                            }
                        }
                    }
                }
                js = json.ToString(); if (js != "")
                {
                    js = js.Substring(0, js.Length - 1);
                }
            }
            catch { }
            return("{" + js + "}");
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string id   = context.Request["pid"];
            string stop = context.Request["stop"];
            string sql  = null;

            if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(stop))
            {
                try
                {
                    //用户操作权限审核

                    if (SOSOshop.BLL.PowerPass.isPass("001009003"))
                    {
                        int sp = int.Parse(stop);

                        SOSOshop.BLL.Db db = new SOSOshop.BLL.Db();
                        if (sp == 1)
                        {
                            sql = "update product set Product_bShelves=1,Product_bStop=" + stop + " where Product_ID=" + id;//商品停用并下架
                        }
                        else
                        {
                            sql = "update product set Product_bStop=" + stop + " where Product_ID=" + id;//商品启用,不改变商品上下架状态
                        }
                        //context.Response.Write(sql);
                        int result = db.ExecuteNonQuery(sql);

                        //大表同步更新
                        //sql = "";



                        context.Response.Write("{\"state\":" + result + ",\"message\":\"已处理\"}");
                    }
                    else
                    {
                        context.Response.Write("{\"state\":-1,\"message\":\"对不起!您没有操作权限。\"}");
                    }
                }
                catch (Exception x)
                {
                    context.Response.Write("{\"state\":-1,\"message\":\"" + x.Message + sql + "\"}");
                }
            }
            else
            {
                context.Response.Write("{\"state\":-1,\"message\":\"操作错误!\"}");
            }
        }
Beispiel #16
0
 protected void Page_Load(object sender, EventArgs e)
 {
     #region ajax 上架、下架、删除
     if (!string.IsNullOrEmpty(Request.QueryString["ajax"]))
     {
         if (SOSOshop.BLL.PowerPass.isPass("008011002"))
         {
             string id       = Request.Form["id"];
             string Shangjia = Request.Form["Shangjia"];
             string Del      = Request.Form["Del"];
             string s        = "";
             if (!string.IsNullOrEmpty(Shangjia) && Shangjia == "1")
             {
                 s = string.Format("update MemberIntegralGift set [State]=(case when State=1 then 2 when State=2 then 1 else State end) where [id]={0}", id);
             }
             else if (!string.IsNullOrEmpty(Del) && Del == "1")
             {
                 s = string.Format("update MemberIntegralGift set [State]=0 where [id]={0}", id);
             }
             try
             {
                 SOSOshop.BLL.Db db  = new SOSOshop.BLL.Db();
                 int             ret = db.ExecuteNonQuery(s);
                 if (ret > 0)
                 {
                     Response.Write("{\"state\":1,\"message\":\"处理成功!\"}");
                 }
                 else
                 {
                     Response.Write("{\"state\":0,\"message\":\"处理失败!\"}");
                 }
             }
             catch (Exception x)
             {
                 Response.Write("{\"state\":-2,\"message\":\"" + x.Message + "\"}");
             }
         }
         else
         {
             Response.Write("{\"state\":-1,\"message\":\"对不起,您没有编辑权限,请联系管理员!\"}");
         }
         Response.End();
     }
     #endregion
     if (!this.Page.IsPostBack)
     {
         SOSOshop.BLL.PromptInfo.Popedom("008011002");
         GetList();
     }
 }
Beispiel #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region ajax 修改积分
            if (!string.IsNullOrEmpty(Request.QueryString["ajax"]))
            {
                if (SOSOshop.BLL.PowerPass.isPass("008011001"))
                {
                    string id       = Request.Form["id"];
                    string integral = Request.Form["integral"];
                    string s        = string.Format("update MemberIntegralTemplate set [integral]={0} where [id]={1}", integral, id);
                    try
                    {
                        SOSOshop.BLL.Db db  = new SOSOshop.BLL.Db();
                        int             ret = db.ExecuteNonQuery(s);
                        if (ret > 0)
                        {
                            Response.Write("{\"state\":1,\"message\":\"更新成功!\"}");
                        }
                        else
                        {
                            Response.Write("{\"state\":0,\"message\":\"更新失败!\"}");
                        }
                    }
                    catch (Exception x)
                    {
                        Response.Write("{\"state\":-2,\"message\":\"" + x.Message + "\"}");
                    }
                }
                else
                {
                    Response.Write("{\"state\":-1,\"message\":\"对不起,您没有编辑权限,请联系管理员!\"}");
                }
                Response.End();
            }
            #endregion

            //修改积分倍数
            if (!string.IsNullOrEmpty(Request.Form["multiple"]))
            {
                bllo.update(Request.Form["id"], int.Parse(Request.Form["multiple"]));
                Response.End();
            }

            if (!this.Page.IsPostBack)
            {
                SOSOshop.BLL.PromptInfo.Popedom("008011001");
                GetList();
            }
        }
        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="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("");
            }
        }
Beispiel #20
0
        /// <summary>
        /// 取得商品标签
        /// </summary>
        /// <param name="dr"></param>
        /// <returns></returns>
        public static string Tag(DataRow dr)
        {
            return("");

            SOSOshop.BLL.Db db = new SOSOshop.BLL.Db();
            StringBuilder   sb = new StringBuilder();

            //拆零
            bool is_cl = (string)dr["is_cl"] == "是";
            //控销
            bool is_kong = (decimal)dr["price_03"] > 0;
            //2012基药标签
            bool is_Jy = ((string)dr["tag_ids"]).Contains(",66,");
            //包含中标价、调入挂网价

            bool is_Zb = !dr.IsNull("zbj") && decimal.Parse(dr["zbj"].ToString()) > 0;
            bool is_Dr = !dr.IsNull("drj") && decimal.Parse(dr["drj"].ToString()) > 0;

            if (is_cl || is_kong || is_Jy || is_Zb || is_Dr)
            {
                sb.Append(" <div class='detail_img_ico'>");
                if (is_Jy)
                {
                    sb.Append(" <span class=\"bkjy_ico bkjy_ico_1\">520</span>");
                }
                if (is_Zb)
                {
                    sb.Append(" <span class=\"bkjy_ico bkjy_ico_2\">中标基</span>");
                }
                if (is_Dr)
                {
                    sb.Append(" <span class=\"bkjy_ico bkjy_ico_3\">调入基</span>");
                }
                if (is_cl)
                {
                    sb.Append(" <span class='bkcl_ico'>拆零</span>");
                }
                if (is_kong)
                {
                    sb.Append(" <span class='kx_ico'>控</span>");
                }

                sb.Append("</div>");
            }
            return(sb.ToString());
        }
Beispiel #21
0
        /// <summary>
        /// 重新计算是否有在出售的otc品种
        /// </summary>
        public static void InitProduct_otc()
        {
            SOSOshop.BLL.Db bll = new SOSOshop.BLL.Db();
            DataSet         ds1 = bll.ExecuteDataSet("select id from Tag_PharmAttribute AS tag where tag_id=71 order by id");

            SOSOshop.BLL.DrugsBase.Tag_PharmAttribute ta = new SOSOshop.BLL.DrugsBase.Tag_PharmAttribute();
            for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
            {
                int    tagid = (int)ds1.Tables[0].Rows[i][0];
                int    count = ta.GetCount(tagid);
                string sql   = string.Format(@"IF EXISTS(SELECT * FROM Tag_PharmAttribute_Product_Count WHERE Tag_PharmAttribute_id={1})
UPDATE Tag_PharmAttribute_Product_Count SET Product_Count={0} WHERE Tag_PharmAttribute_id={1}
ELSE
INSERT Tag_PharmAttribute_Product_Count (Tag_PharmAttribute_id,Product_Count) VALUES({1},{0})", count, tagid);
                bll.ExecuteNonQuery(sql);
            }
        }
 /// <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);
 }
Beispiel #23
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 += "&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());
        }
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            int    Product_ID    = 0; int.TryParse(request("txtId"), out Product_ID);
            string Product_Name  = request("TextBox1");
            string SellingPoint  = request("TextBox2");
            string Advertisement = request("TextBox3");

            string sql = "update product set Product_Name=@Product_Name, Product_SellingPoint=@Product_SellingPoint, Product_Advertisement=@Product_Advertisement,drug_sensitive=@drug_sensitive,SellType=@SellType where Product_ID=@Product_ID";

            try
            {
                SOSOshop.BLL.Db db        = new SOSOshop.BLL.Db();
                DbCommand       dbCommand = db._db.GetSqlStringCommand(sql);
                db._db.AddInParameter(dbCommand, "Product_ID", DbType.Int32, Product_ID);
                db._db.AddInParameter(dbCommand, "Product_Name", DbType.AnsiString, Product_Name);
                db._db.AddInParameter(dbCommand, "Product_SellingPoint", DbType.AnsiString, SellingPoint);
                db._db.AddInParameter(dbCommand, "Product_Advertisement", DbType.AnsiString, Advertisement);
                db._db.AddInParameter(dbCommand, "drug_sensitive", DbType.Boolean, bool.Parse(DropDowndrug_sensitive1.SelectedValue));
                db._db.AddInParameter(dbCommand, "SellType", DbType.Int32, int.Parse(DropDownSellType.SelectedValue));
                int ret = db._db.ExecuteNonQuery(dbCommand);
                if (ret > 0)
                {
                    AdminInfo adminModel = (AdminInfo)SOSOshop.BLL.AdministrorManager.Get();
                    SOSOshop.BLL.Logs.Log.LogAdminAdd(string.Format("编辑商品:[{0}][{1}]", Product_ID, TextBox1.Text), adminModel.AdminId, adminModel.AdminName, 1);

                    this.ltlMsg.Text     = "保存成功·<script>if(confirm('编辑成功!继续编辑请点击确定。')){location.href='product_edit.aspx?pid=" + Product_ID + "';}else{location.href='" + ViewState["returnUrl"] + "';}</script>";
                    this.pnlMsg.Visible  = true;
                    this.pnlMsg.CssClass = "actionOk";
                }
                else
                {
                    this.ltlMsg.Text     = "保存失败";
                    this.pnlMsg.Visible  = true;
                    this.pnlMsg.CssClass = "actionErr";
                }
            }
            catch (Exception ex)
            {
                this.ltlMsg.Text     = "保存失败" + "\r\n" + ex.ToString();
                this.pnlMsg.Visible  = true;
                this.pnlMsg.CssClass = "actionErr";
            }
        }
Beispiel #25
0
        public void ProcessRequest(HttpContext context)
        {
            string id   = context.Request["pid"];
            string stop = context.Request["verify"];
            string sql  = null;

            if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(stop))
            {
                try
                {
                    //用户操作权限审核
                    if (SOSOshop.BLL.PowerPass.isPass("001009002"))
                    {
                        int sp = int.Parse(stop);

                        SOSOshop.BLL.Db db = new SOSOshop.BLL.Db();
                        if (sp == 1)
                        {
                            sql = "update product set Product_bShelves=0,Product_bStop=0, shop_state=0 where Product_ID=" + id;//审核商品
                        }
                        //context.Response.Write(sql);
                        int result = db.ExecuteNonQuery(sql);

                        //大表同步更新
                        sql = "";

                        context.Response.Write("{\"state\":" + result + ",\"message\":\"已处理\"}");
                    }
                    else
                    {
                        context.Response.Write("{\"state\":-1,\"message\":\"对不起!您没有审核权限。\"}");
                    }
                }
                catch (Exception x)
                {
                    context.Response.Write("{\"state\":-1,\"message\":\"" + x.Message + "\"}");
                }
            }
            else
            {
                context.Response.Write("{\"state\":-1,\"message\":\"操作错误!\"}");
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string bshelves = context.Request["bshelves"];
            string state    = context.Request["state"];
            string pid      = context.Request["pid"];

            if (!string.IsNullOrEmpty(pid))
            {
                if (SOSOshop.BLL.PowerPass.isPass("001009004"))
                {
                    string s = string.Format("update product set Product_State='{1}' where [Product_ID]={2}", bshelves, state, pid);
                    try
                    {
                        SOSOshop.BLL.Db db  = new SOSOshop.BLL.Db();
                        int             ret = db.ExecuteNonQuery(s);
                        if (ret > 0)
                        {
                            AdminInfo adminModel = (AdminInfo)SOSOshop.BLL.AdministrorManager.Get();
                            SOSOshop.BLL.Logs.Log.LogAdminAdd(string.Format("{2}了商品:[{0}][{1}]", pid, new SOSOshop.BLL.Db().ExecuteScalar("SELECT Product_Name FROM dbo.Product WHERE Product_ID=" + pid), bshelves == "1" ? "上架" : "下架"), adminModel.AdminId, adminModel.AdminName, 1);
                            context.Response.Write("{\"state\":" + ret + ",\"message\":\"更新成功!\"}");
                        }
                        else
                        {
                            context.Response.Write("{\"state\":" + ret + ",\"message\":\"更新失败!\"}");
                        }
                    }
                    catch (Exception x)
                    {
                        context.Response.Write("{\"state\":-2,\"message\":\"" + x.Message + "\"}");
                    }
                }
                else
                {
                    context.Response.Write("{\"state\":-1,\"message\":\"对不起,您没有编辑权限,请联系管理员!\"}");
                }
            }
            else
            {
                context.Response.Write("{\"state\":-1,\"message\":\"未知错误!\"}");
            }
        }
Beispiel #27
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string id      = context.Request["pid"];
            string shelves = context.Request["shelves"];

            if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(shelves))
            {
                try
                {
                    //用户操作权限审核
                    if (SOSOshop.BLL.PowerPass.isPass("001009005"))
                    {
                        SOSOshop.BLL.Db db = new SOSOshop.BLL.Db();


                        string sql = string.Format("UPDATE product SET beactive='{0}' ,Product_bShelves='{1}' WHERE Product_ID={2}", shelves.Equals("1") ? "是" : "否", shelves, id);
                        //context.Response.Write(sql);
                        int       result     = db.ExecuteNonQuery(sql);
                        AdminInfo adminModel = (AdminInfo)SOSOshop.BLL.AdministrorManager.Get();
                        SOSOshop.BLL.Logs.Log.LogAdminAdd(string.Format("{2}了商品:[{0}][{1}]", id, new SOSOshop.BLL.Db().ExecuteScalar("SELECT Product_Name FROM dbo.Product WHERE Product_ID=" + id), shelves == "1" ? "上架" : "下架"), adminModel.AdminId, adminModel.AdminName, 1);
                        //大表同步更新
                        sql = "";

                        context.Response.Write("{\"state\":" + result + ",\"message\":\"已处理\"}");
                    }
                    else
                    {
                        context.Response.Write("{\"state\":-1,\"message\":\"对不起!您没有操作权限。\"}");
                    }
                }
                catch (Exception x)
                {
                    context.Response.Write("{\"state\":-1,\"message\":\"" + x.Message + "\"}");
                }
            }
            else
            {
                context.Response.Write("{\"state\":-1,\"message\":\"操作错误!\"}");
            }
        }
Beispiel #28
0
        public void ProcessRequest(HttpContext context)
        {
            int UID = _101shop.v3.Controllers.BaseController.GetUserId();//账户ID

            if (UID > 0)
            {
                //调用ERP:wldwwdzl往来单位文档资料的图片
                string wldwwdid = context.Request.QueryString["wldwwdid"];
                if (!string.IsNullOrEmpty(wldwwdid))
                {
                    SOSOshop.BLL.Db bll  = new SOSOshop.BLL.Db();
                    object          Data = bll.ExecuteScalar("SELECT wldwwd_image FROM wldwwdzl WHERE wldwwdid='" + wldwwdid.Replace("'", "") + "'");
                    if (Data != null)
                    {
                        byte[] imageData = (byte[])Data;
                        //写入图片信息到输出流中
                        context.Response.OutputStream.Write(imageData, 78, imageData.Length - 78);
                    }
                }
            }
        }
        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 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);
 }