Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            NowDate = DateTime.Now.ToString();
            BLL.UserBLL           ubll = new BLL.UserBLL();
            BLL.MerchantBLL       mbll = new BLL.MerchantBLL();
            Model.CurrentMerModel cm   = BLL.MerchantBLL.CurrentModel();



            CurrentUserId = cm.CurrentUserId;
            IsAdmin       = ubll.IsAdministrator();

            if (CurrentUserId.Trim() == "" || CurrentUserId == null)
            {
                IsLogin = false;
                Response.Write("<script src=\"/Script/jquery-1.8.2.js\"></script><script src = \"/Script/ZYUiPub.js\" ></script> ");
                Response.Write("<script>window.parent.LoginCookie(); setTimeout(function(){ shuaxin(); },1000)  </script>");
                Response.End();
                // throw new Exception("您还没有登录!");
            }
            else
            {
                IsLogin = true;
            }

            StringBuilder s = new StringBuilder();

            s.Append(" var CurrentUserId='" + CurrentUserId + "'; ");
            s.Append(" var IsAdmin=" + IsAdmin.ToString().ToLower() + "; ");
            s.Append(" var IsLogin="******"; ");

            try
            {
                decimal MerId = Convert.ToDecimal(Request.QueryString["MerId"]);
                if (MerId == 0)
                {
                    MerId = BLL.MerchantBLL.CurrentModel().CurrentMerId;
                }

                if (MerId == 0)
                {
                }
                else
                {
                    mbll.CheckChangeMerPower(MerId);
                }



                MerJson = Common.JsonHelper.ToJsonNo1(mbll.GetMerInfoFaseById(MerId));

                s.Append(" var MerJson=" + MerJson + "; ");
            }
            catch
            {
            }

            ScriptStr = s.ToString();
        }
Exemplo n.º 2
0
        private void GetMerListData()
        {
            BLL.MerchantBLL bllMer = new BLL.MerchantBLL();

            DataTable dt = bllMer.GetMerList(" FlagInvalid=0 ");

            ReDict.Add("MerListData", Common.JsonHelper.ToJson(dt));
            ReTrue();
        }
Exemplo n.º 3
0
        private void GetMerList()
        {
            string CurrentUserId = ReStr("CurrentUserId");

            BLL.MerchantBLL bll = new BLL.MerchantBLL();
            try
            {
                DataTable dt = bll.GetMerList("  ");
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 4
0
 private void SaveUser()
 {
     Model.UserInfoModel model = new Model.UserInfoModel();
     model.Birthday     = ReTime("Birthday", DateTime.Parse("1900-01-01"));
     model.CreateTime   = DateTime.Now;
     model.Currency     = 0;
     model.Email        = ReStr("Email", "");
     model.FlagMerchant = true;
     model.IdNo         = ReStr("IdNo", "");
     model.Memo         = ReStr("Memo", "");
     model.Phone        = ReStr("Phone", "");
     model.PicBig       = ReStr("PicBig", "");
     model.PicMid       = ReStr("PicMid", "");
     model.PicSmall     = ReStr("PicSmall", "");
     model.Power        = 0;
     model.Pwd          = ReStr("Pwd", "");
     model.PwdMd5       = ReStr("PwdMd5", "");
     model.qq           = ReStr("qq", "");
     model.RealName     = ReStr("RealName", "");
     model.Sex          = ReStr("sex", "未知");
     model.StreetId     = 0;
     model.Tell         = ReStr("Tell", "");
     model.TownId       = 1;
     model.UserCode     = ReInt("UserCode", 0);
     model.UserId       = ReStr("uid", "");
     if (model.UserId.Trim() == "")
     {
         throw new Exception("不能为空!");
     }
     model.UserLv     = ReInt("UserLv", 90);
     model.UserTitle  = ReStr("UserTitle", "");
     model.UserTypeId = 3;
     model.Validated  = ReBool("Validated", true);
     model.WxOpenID   = ReStr("WxOpenID", "");
     BLL.MerchantBLL mbll = new BLL.MerchantBLL();
     BLL.UserBLL     ubll = new BLL.UserBLL();
     if (model.UserId == "小王")
     {
         if (ubll.CurrentUserId() != "小王")
         {
             throw new Exception("小王不是一般人能改的!-_-!");
         }
     }
     ubll.SaveMyUserInfo(model);
     ReTrue();
 }
Exemplo n.º 5
0
        private void GetMerData()
        {
            try
            {
                BLL.TownBLL     bll         = new BLL.TownBLL();
                BLL.MerchantBLL bllMer      = new BLL.MerchantBLL();
                DataTable       dt          = bll.GetTownList();
                string          json        = Common.JsonHelper.ToJson(dt);
                DataTable       dtMerType   = bllMer.GetMerTypeList("");
                string          jsonMerType = Common.JsonHelper.ToJson(dtMerType);
                ReDict.Add("TownList", json);           //乡镇类别
                ReDict.Add("jsonMerType", jsonMerType); //商家类别

                ReTrue();
            }
            catch (Exception ex)
            {
                ReThrow(ex);
            }
        }
Exemplo n.º 6
0
        private void AddUser()
        {
            BLL.MerchantBLL          mbll    = new BLL.MerchantBLL();
            BLL.UserBLL              ubll    = new BLL.UserBLL();
            Model.UserInfoModel      model   = new Model.UserInfoModel();
            Model.MerRoleVsUserModel vsModel = new Model.MerRoleVsUserModel();
            model.UserId = ReStr("uid", "");

            if (model.UserId.Length < 5)
            {
                throw new Exception("用户名不能小于5个字符!");
            }


            model.CreateTime = DateTime.Now;
            model.Birthday   = DateTime.Parse("1900-01-01");

            #region 事务开启

            TransactionOptions transactionOption = new TransactionOptions();
            transactionOption.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOption))
            {
                #endregion

                ubll.AddUser(model);
                vsModel.UserId    = model.UserId;
                vsModel.BranchId  = ReStr("BranchId", "");
                vsModel.MerRoleId = ReDecimal("MerRoleId", 0);
                mbll.SaveMerRoleVsUser(vsModel);



                #region 事务关闭

                transactionScope.Complete();
            }
            #endregion
            ReTrue();
        }
Exemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Model.CurrentMerModel cm   = BLL.MerchantBLL.CurrentModel();
            BLL.MerchantBLL       mBll = new BLL.MerchantBLL();


            StringBuilder s = new StringBuilder();

            s.Append(" select * from dbo.MerRole with(nolock) where MerId='" + cm.CurrentMerId + "' "); //0
            s.Append(" select * from CORE.dbo.MenuVsMerRole with(nolock)   ");                          //1
            s.Append(" select * from CORE.dbo.MenuInfo with(nolock) where AdminPower!=100 ");           //2
            s.Append(" select * from CORE.dbo.AppMenuVsMerRole with(nolock) ");                         //3
            s.Append(" select * from CORE.dbo.AppMenuInfo with(nolock) ");                              //4

            s.Append(" SELECT * FROM  DBMSG.dbo.MsgType with(nolock) WHERE TargetLv BETWEEN 10 AND 20  ");

            DataSet ds = DAL.DalComm.BackData(s.ToString());


            DataTable dtMerRole = ds.Tables[0];

            DataTable dtMerMenuVsMerRole    = ds.Tables[1];
            DataTable dtMernu               = ds.Tables[2];
            DataTable dtAppMenu             = ds.Tables[4];
            DataTable dtAppMerMenuVsMerRole = ds.Tables[3];

            DataTable dtMsgType = ds.Tables[5];

            StringBuilder w = new StringBuilder();

            foreach (DataRow dr in dtMerRole.Rows)
            {
                w.Append(" <li  MerRoleId='" + dr["MerRoleId"] + "'>" + dr["MerRoleName"] + "</li>");
            }

            MerRoleListHtml = w.ToString();
            w.Clear();
            #region PC菜单开始
            DataTable dtParentMenu = Common.DataSetting.TableSelect(" ParentMenuId='' ", dtMernu);



            foreach (DataRow dr in dtParentMenu.Rows)
            {
                string MenuId   = dr["MenuId"].ToString();
                string MenuName = dr["MenuName"].ToString();
                w.Append("<dl>");
                w.Append("<dt MenuId='" + MenuId + "' >");
                w.Append("<input class='cb_sel' type='checkbox' />");
                w.Append(MenuName);
                w.Append("</dt>");

                DataTable dtCldMenu = Common.DataSetting.TableSelect(" ParentMenuId='" + MenuId + "'  ", dtMernu);
                if (dtCldMenu.Rows.Count > 0)
                {
                    foreach (DataRow drCld in dtCldMenu.Rows)
                    {
                        string CldMenuId   = drCld["MenuId"].ToString();
                        string CldMenuName = drCld["MenuName"].ToString();

                        w.Append("<dd MenuId='" + CldMenuId + "'>");
                        w.Append("<input class='cb_sel' type='checkbox' />");
                        w.Append(CldMenuName);
                        w.Append("</dd>");
                    }
                }



                w.Append("</dl>");
            }

            MenuListHtml = w.ToString();
            w.Clear();
            #endregion

            #region 手机菜单开始
            //手机菜单开始
            DataTable dtParentAppMenu = Common.DataSetting.TableSelect(" ParentAppMenuId='' ", dtAppMenu);

            foreach (DataRow dr in dtParentAppMenu.Rows)
            {
                string AppMenuId   = dr["AppMenuId"].ToString();
                string AppMenuName = dr["AppMenuName"].ToString();
                w.Append("<dl>");
                w.Append("<dt AppMenuId='" + AppMenuId + "' >");
                w.Append("<input class='cb_sel' type='checkbox' />");
                w.Append(AppMenuName);
                w.Append("</dt>");

                DataTable dtCldAppMenu = Common.DataSetting.TableSelect(" ParentAppMenuId='" + AppMenuId + "'  ", dtAppMenu);
                if (dtCldAppMenu.Rows.Count > 0)
                {
                    foreach (DataRow drCld in dtCldAppMenu.Rows)
                    {
                        string CldAppMenuId   = drCld["AppMenuId"].ToString();
                        string CldAppMenuName = drCld["AppMenuName"].ToString();

                        w.Append("<dd AppMenuId='" + CldAppMenuId + "'>");
                        w.Append("<input class='cb_sel' type='checkbox' />");
                        w.Append(CldAppMenuName);
                        w.Append("</dd>");
                    }
                }



                w.Append("</dl>");
            }


            AppMenuListHtml = w.ToString();
            #endregion



            #region 消息侦听开始


            w.Clear();
            if (dtMsgType.Rows.Count > 0)
            {
                foreach (DataRow drMsgType in dtMsgType.Rows)
                {
                    w.Append("<a class='a_MsgType' id='a_" + drMsgType["MsgTypeId"] + "'   MsgTypeId='" + drMsgType["MsgTypeId"] + "'  >");
                    w.Append(drMsgType["MsgTypeName"].ToString());
                    w.Append("</a>");
                }
                MsgTypeHtml = w.ToString();
            }
            #endregion
        }
Exemplo n.º 8
0
    private void SendPeiHuoRemind()  //配货人员提醒
    {
        BLL.WxBLL wbll        = new BLL.WxBLL();
        string    DingDanId   = ReStr("DingDanId", "");
        DataTable dtUser      = ReTable("UserList");
        string    SendMemo    = ReStr("SendMemo", "");
        decimal   QyWxPtAppId = ReDecimal("QyWxPtAppId", 0);


        StringBuilder w          = new StringBuilder();
        StringBuilder s          = new StringBuilder();
        List <string> ToUserList = new List <string>();

        #region 事务开启

        TransactionOptions transactionOption = new TransactionOptions();
        transactionOption.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
        using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOption))
        {
            #endregion

            BLL.MerchantBLL mbll = new BLL.MerchantBLL();
            mbll.ShenHeDingdan(DingDanId, 1, "通过审核");
            s.Append("SELECT * FROM dbo.DingDanDetailView WITH(NOLOCK) WHERE DingDanId='" + DingDanId + "' ORDER BY DingDanDetailTypeId ");
            s.Append(" SELECT *  FROM dbo.DingDanView  WITH(NOLOCK) WHERE DingDanId='" + DingDanId + "' ");

            DataSet   ds       = DAL.DalComm.BackData(s.ToString());
            DataTable dtDetail = ds.Tables[0];
            DataTable dtInfo   = ds.Tables[1];
            if (dtInfo.Rows.Count != 1)
            {
                throw new Exception("这是个什么订单?");
            }
            DataRow  drInfo       = dtInfo.Rows[0];
            decimal  MerId        = decimal.Parse(drInfo["MerchantId"].ToString());
            decimal  amount       = decimal.Parse(drInfo["Amount"].ToString());
            DateTime PeiSongTime1 = DateTime.Parse(drInfo["PeiSongTime1"].ToString());
            DateTime PeiSongTime2 = DateTime.Parse(drInfo["PeiSongTime2"].ToString());
            amount = Math.Round(amount, 2);
            w.Append("编号:\n " + DingDanId + " \n");

            if (SendMemo.Trim() != "")
            {
                w.Append("调度备注:" + SendMemo + " \n");
            }

            w.Append("总金额:" + amount + " \n");
            w.Append("物流:" + PeiSongTime1.ToString("yy年MM月dd日 hh时mm分") + "-" + PeiSongTime2.ToString("yy年MM月dd日 hh时mm分") + "");
            w.Append("(" + drInfo["PeiSongTypeName"] + ") \n");
            var url = "http://www.sjdfcs.com/App/AppDingDanList_PeiHuo.aspx?DingDanId=" + DingDanId + "";

            w.Append("<a href='" + wbll.QyWxUrl(url, MerId) + "' >查看详细</a> \n");
            if (dtDetail.Rows.Count == 0)
            {
                throw new Exception("这个订单[" + DingDanId + "]没有明细吗?");
            }
            s.Clear();
            foreach (DataRow drUser in dtUser.Rows)
            {
                ToUserList.Add(drUser["QyWxPtUserId"].ToString());
                s.Append(" UPDATE dbo.DingDanInfo SET PeiHuoUserId='" + drUser["UserId"].ToString() + "',Status=20 WHERE DingDanId='" + DingDanId + "' ");
            }
            DAL.DalComm.ExReInt(s.ToString());



            #region 暂时无用

            //foreach (DataRow drDetail in dtDetail.Rows)
            //{


            //    decimal Price = decimal.Parse(drDetail["Price"].ToString());
            //    Price = Math.Round(Price, 2);
            //    decimal Quantity = decimal.Parse(drDetail["Quantity"].ToString());
            //    Quantity = Math.Round(Quantity);

            //    string 规格 = drDetail["规格"].ToString().Trim();

            //    int DingDanDetailTypeId = int.Parse(drDetail["DingDanDetailTypeId"].ToString());
            //    if (DingDanDetailTypeId == 10)
            //    {

            //        w.Append("配送费:" + Price + "元 \n");

            //    }
            //    else
            //    {


            //        //如果是产品
            //        w.Append("[" + drDetail["产品编号"] + "]");
            //        w.Append("" + drDetail["产品名称"] + ",");
            //        if (规格 != "")
            //        {
            //            w.Append("规格:" + drDetail["规格"] + ",");

            //        }

            //        w.Append("单价:" + Price + "元,");
            //        w.Append("数量:" + Quantity + "" + drDetail["计量单位"] + "");
            //        w.Append(" \n ");
            //    }
            //}
            #endregion



            #region 事务关闭

            transactionScope.Complete();
        }
        #endregion
        string jsonStr = wbll.SendQyTextMsg(ToUserList, w.ToString(), QyWxPtAppId);

        ReDict.Add("ReJson", jsonStr);
        ReTrue();
    }