/// <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);
        }
コード例 #2
0
ファイル: Timer.cs プロジェクト: Audery/Audery-Repository
        /// <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);
            }
        }
コード例 #3
0
 public void ProcessRequest(HttpContext context)
 {
     context.Response.ContentType = "text/html";
     SOSOshop.BLL.SysParameter sp = new SOSOshop.BLL.SysParameter();
     #region
     //是否允许注册新用户
     if (!sp.IsRegistered)
     {
         ChangeHope.WebPage.Script.AlertAndGoBack("温馨提示:目前不允许新用户注册!");
     }
     else
     {
         if (ChangeHope.WebPage.PageRequest.GetFormString("Option") != string.Empty)
         {
             context.Response.Clear();
             string types = context.Request.Form["Option"].Trim();
             if (types == "NewRegisteredMembers" && context.Session["DoNotTipForNewRegisteredMembers"] == null)
             {
                 if (context.Request.Form["DoNotTip"] != null && context.Request.Form["DoNotTip"] == "Yes")
                 {
                     context.Session["DoNotTipForNewRegisteredMembers"] = true;
                     context.Response.End();
                     return;
                 }
                 string          json = "";//获取这两天刚注册的未导入CRM的会员
                 SOSOshop.BLL.Db db   = new SOSOshop.BLL.Db();
                 DataSet         ds   = db.ExecuteDataSet("SELECT a.UID,a.UserId,a.Email,b.TrueName,b.MobilePhone,a.RegisterIP FROM yxs_memberaccount AS a INNER JOIN yxs_memberinfo AS b ON a.UID=b.UID WHERE datediff(DAY,RegisterDate,GETDATE())<=2 AND Member_Class=1 AND State=0 AND CRMID=0");
                 if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                 {
                     for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                     {
                         DataRow dr = ds.Tables[0].Rows[i];
                         json += "{id:" + dr["UID"] + ",name:\"" + Convert.ToString(dr["UserId"]).Replace("\"", "") +
                                 "\",email:\"" + Convert.ToString(dr["Email"]).Replace("\"", "") +
                                 "\",truename:\"" + Convert.ToString(dr["TrueName"]).Replace("\"", "") +
                                 "\",mobilephone:\"" + Convert.ToString(dr["MobilePhone"]).Replace("\"", "") +
                                 "\",location:\"" + ChangeHope.WebPage.PageRequest.GetIPLocation(Convert.ToString(dr["RegisterIP"])).Replace("\"", "") + "\"},";
                     }
                     if (json != "")
                     {
                         json = json.Substring(0, json.Length - 1);
                     }
                     json = "{result:[" + json + "]}";
                 }
                 context.Response.Write(json);
                 context.Response.End();
                 return;
             }
             else if (types == "NewRegisteredMembersDebug")
             {
                 string json = "";
                 for (int i = 1; i < 10; i++)
                 {
                     json += "{id:" + i + ",name:\"会员名" + i + "\"},";
                 }
                 if (json != "")
                 {
                     json = json.Substring(0, json.Length - 1);
                 }
                 json = "{result:[" + json + "]}";
                 context.Response.Write(json);
                 context.Response.End();
                 return;
             }
         }
     }
     #endregion
 }