Exemplo n.º 1
0
    /// <summary>
    /// 删除物流信息
    /// </summary>
    /// <param name="json"></param>
    private void ComlogDel(string json)
    {
        string        bind   = "{\"ds\":\"1\",\"prompt\":\"提交失败\"}";
        StringBuilder strSql = new StringBuilder();

        try
        {
            List <Hi.Model.BD_ComLogistics> cl = new Hi.BLL.BD_ComLogistics().GetList("", "CompID=" + this.CompID + " and LogisticsName='" + json + "' and dr=0", "");

            if (cl != null && cl.Count > 0)
            {
                foreach (Hi.Model.BD_ComLogistics item in cl)
                {
                    item.dr = 1;
                    new Hi.BLL.BD_ComLogistics().Update(item);
                }

                bind = "{\"ds\":\"0\",\"prompt\":\"删除成功!\"}";
            }
            else
            {
                bind = "{\"ds\":\"3\",\"prompt\":\"没有删除的数据!\"}";
            }
        }
        catch (Exception)
        {
            bind = "{\"ds\":\"1\",\"prompt\":\"提交失败!\"}";
        }
        finally
        {
            Response.Write(bind);
            Response.End();
        }
    }
Exemplo n.º 2
0
    public void logisticsbind()
    {
        List <Hi.Model.BD_ComLogistics> cl = new Hi.BLL.BD_ComLogistics().GetList("", "dr=0 and CompID=" + CompID, "");

        if (cl != null && cl.Count > 0)
        {
            this.rptlogista.DataSource = cl;
            this.rptlogista.DataBind();
        }
    }
Exemplo n.º 3
0
    public void bind()
    {
        List <Hi.Model.BD_ComLogistics> cl = new Hi.BLL.BD_ComLogistics().GetList("", "dr=0 and CompID=" + this.CompID, "");

        if (cl != null && cl.Count > 0)
        {
            var json = "{";
            //string str = string.Empty;
            for (int i = 0; i <= cl.Count - 1; i++)
            {
                //str += "<li title=\"" + cl[i].LogisticsName + "\" class=\"Comli\">" + cl[i].LogisticsName + "</li>";
                json += ",\"" + i + "\":\"" + cl[i].LogisticsName + "\"";
            }
            //this.ulComLog.InnerHtml = str;
            json += "}";
            json  = json.Replace("{,\"0\"", "{\"0\"");

            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>bindComLog('" + json + "')</script>");
        }
    }
Exemplo n.º 4
0
    public ResultLogistics GetLogisticsList(string JSon)
    {
        try
        {
            #region JSon取值

            string userID = string.Empty;
            string compID = string.Empty;

            JsonData JInfo = JsonMapper.ToObject(JSon);
            if (JInfo.Count > 0 && JInfo["CompanyID"].ToString() != "" && JInfo["UserID"].ToString() != "")
            {
                userID = JInfo["UserID"].ToString();
                compID = JInfo["CompanyID"].ToString();
            }
            else
            {
                return(new ResultLogistics {
                    Result = "F", Description = "参数异常"
                });
            }

            Hi.Model.SYS_Users user = new Hi.Model.SYS_Users();
            if (!new Common().IsLegitUser(int.Parse(userID), out user, int.Parse(compID)))
            {
                return new ResultLogistics()
                       {
                           Result = "F", Description = "登录信息异常"
                       }
            }
            ;

            #endregion

            List <LogisticsChoice>          LogisticsChoiceList = new List <LogisticsChoice>();
            List <Hi.Model.BD_ComLogistics> list = new Hi.BLL.BD_ComLogistics().GetList("", "CompID='" + compID + "' and Enabled=0 and dr=0", "");
            if (list != null && list.Count > 0)
            {
                foreach (var item in list)
                {
                    LogisticsChoice one = new LogisticsChoice();
                    one.LogisticsCode = item.LogisticsCode;
                    one.LogisticsName = item.LogisticsName;
                    LogisticsChoiceList.Add(one);
                }
                return(new ResultLogistics
                {
                    Result = "T",
                    LogisticsChoiceList = LogisticsChoiceList
                });
            }
            return(new ResultLogistics {
                Result = "T", Description = "未找到绑定的物流公司"
            });
        }
        catch (Exception ex)
        {
            Common.CatchInfo(ex.Message + ":" + ex.StackTrace, "GetLogisticsList :" + JSon);
            return(new ResultLogistics()
            {
                Result = "F", Description = "异常"
            });
        }
    }
Exemplo n.º 5
0
    /// <summary>
    /// 新增保存
    /// </summary>
    /// <param name="json"></param>
    protected void complog(string json)
    {
        JsonData JInfo = JsonMapper.ToObject(json);

        string        bind   = "{\"ds\":\"1\",\"prompt\":\"提交失败\"}";
        StringBuilder strSql = new StringBuilder();

        if (JInfo.Count < 0)
        {
            Response.Write(bind);
            Response.End();
        }
        List <Hi.Model.BD_ComLogistics> cl = new Hi.BLL.BD_ComLogistics().GetList("", "dr=0 and CompID=" + this.CompID, "");

        SqlTransaction TranSaction = null;
        SqlConnection  Connection  = new SqlConnection(SqlHelper.LocalSqlServer);

        Connection.Open();
        TranSaction = Connection.BeginTransaction();

        try
        {
            for (int i = 0; i <= JInfo.Count - 1; i++)
            {
                //系统设置的标题
                string name = JInfo["" + i + ""].ToString();

                List <Hi.Model.BD_ComLogistics> sl = cl.FindAll(p => p.LogisticsName == name);
                if (sl != null && sl.Count > 0)
                {
                }
                else
                {
                    strSql.AppendFormat("INSERT INTO BD_ComLogistics ([CompID],[LogisticsName],[LogisticsCode],[CreateDate],[CreateUserID],[dr],[modifyuser],[ts]) VALUES({0},'{1}',null,'{2}',{3},0,{4},'{5}');", CompID, name, DateTime.Now, UserID, UserID, DateTime.Now);
                }
            }

            if (!strSql.ToString().Equals(""))
            {
                SqlCommand cmd = new SqlCommand(strSql.ToString(), Connection, TranSaction);
                cmd.CommandType = CommandType.Text;
                int rowsAffected = SqlHelper.GetInt(cmd.ExecuteNonQuery().ToString());
                if (rowsAffected > 0)
                {
                    TranSaction.Commit();
                    bind = "{\"ds\":\"0\",\"prompt\":\"提交成功!\"}";
                }
                else
                {
                    TranSaction.Rollback();
                    bind = "{\"ds\":\"1\",\"prompt\":\"提交失败!\"}";
                }
            }
            else
            {
                //没有新增的
                bind = "{\"ds\":\"0\",\"prompt\":\"提交成功!\"}";
            }
        }
        catch (Exception)
        {
            TranSaction.Rollback();
            bind = "{\"ds\":\"1\",\"prompt\":\"提交失败!\"}";
        }
        finally
        {
            Connection.Dispose();

            Response.Write(bind);
            Response.End();
        }
    }
Exemplo n.º 6
0
    /// <summary>
    /// 绑定信息
    /// </summary>
    public void bind()
    {
        //查询该企业的设置
        List <Hi.Model.SYS_SysName> Sysl = new Hi.BLL.SYS_SysName().GetList("", " CompID=" + CompID, "");
        List <Hi.Model.SYS_SysName> sl   = null;

        #region 代理商设置
        //代理商加盟是否需要审核
        sl = Sysl.FindAll(p => p.Name == "代理商加盟是否需要审核");
        if (sl != null && sl.Count > 0)
        {
            if (sl[0].Value.ToString() == "1")
            {
                this.rdodisNo.Checked = true;
            }
            else
            {
                this.rdodisOk.Checked = true;
            }

            sl = null;
        }
        else
        {
            this.rdodisOk.Checked = true;
        }
        #endregion

        #region 代理商支付设置
        //代理商加盟是否需要审核
        sl = Sysl.FindAll(p => p.Name == "支付方式");
        if (sl != null && sl.Count > 0)
        {
            if (sl[0].Value.ToString() == "1")
            {
                this.payDBNo.Checked = true;
            }
            else
            {
                this.payDBOk.Checked = true;
            }

            sl = null;
        }
        else
        {
            this.payDBOk.Checked = true;
        }
        #endregion

        #region 订单配置
        //订单自动签收
        sl = Sysl.FindAll(p => p.Name == "订单自动签收");
        if (sl != null && sl.Count > 0)
        {
            this.txtSinceSign.Value = sl[0].Value;
            sl = null;
        }
        else
        {
            this.txtSinceSign.Value = "15";
        }

        //超时未付款自动作废订单
        sl = Sysl.FindAll(p => p.Name == "超时未付款自动作废订单");
        if (sl != null && sl.Count > 0)
        {
            this.txtSinceOff.Value = sl[0].Value;
            sl = null;
        }
        else
        {
            this.txtSinceOff.Value = "30";
        }

        //代客下单是否需要审核
        sl = Sysl.FindAll(p => p.Name == "代客下单是否需要审核");
        if (sl != null && sl.Count > 0)
        {
            if (sl[0].Value.ToString() == "1")
            {
                this.rdoOrderAddOK.Checked = true;
            }
            else
            {
                this.rdoOrderAddNO.Checked = true;
            }

            sl = null;
        }
        else
        {
            this.rdoOrderAddNO.Checked = true;
        }

        //订单下单数量是否取整
        sl = Sysl.FindAll(p => p.Name == "订单下单数量是否取整");
        if (sl != null && sl.Count > 0)
        {
            if (sl[0].Value.ToString() == "0")
            {
                this.rdoDigits0.Checked = true;
            }
            else
            {
                this.rdoDigits2.Checked = true;
            }
            sl = null;
        }
        else
        {
            this.rdoDigits0.Checked = true;
        }

        sl = Sysl.FindAll(p => p.Name == "订单支付返利是否启用");
        if (sl != null && sl.Count > 0)
        {
            if (sl[0].Value.ToString() == "0")
            {
                this.Rebate1.Checked = true;
            }
            else
            {
                this.Rebate2.Checked = true;
            }
            sl = null;
        }
        else
        {
            this.Rebate1.Checked = true;
        }

        #endregion

        #region 商品配置
        //商品是否启用库存
        sl = Sysl.FindAll(p => p.Name == "商品是否启用库存");
        if (sl != null && sl.Count > 0)
        {
            if (sl[0].Value.ToString() == "0")
            {
                this.rdoStockOk.Checked = true;
            }
            else
            {
                this.rdoStockNo.Checked = true;
            }

            sl = null;
        }
        else
        {
            this.rdoStockOk.Checked = true;
        }

        //商品分类选择是否折叠
        sl = Sysl.FindAll(p => p.Name == "商品分类选择是否折叠");
        if (sl != null && sl.Count > 0)
        {
            if (sl[0].Value.ToString() == "1")
            {
                this.rdoFoldingOk.Checked = true;
            }
            else
            {
                this.rdoFoldingNo.Checked = true;
            }
            sl = null;
        }
        else
        {
            this.rdoFoldingOk.Checked = true;
        }

        sl = Sysl.FindAll(p => p.Name == "商品标签管理");
        if (sl != null && sl.Count > 0)
        {
            string val = sl[0].Value;
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>GoodsL('" + val + "')</script>");
            sl = null;
        }
        else
        {
            this.txtGoodsLable1.Value = "新品上架";
            this.txtGoodsLable2.Value = "热卖推荐";
            this.txtGoodsLable3.Value = "清仓优惠";
        }

        sl = Sysl.FindAll(p => p.Name == "商品自定义字段");
        if (sl != null && sl.Count > 0)
        {
            string val = sl[0].Value;
            ClientScript.RegisterStartupScript(this.GetType(), "GoodsC", "<script>GoodsC('" + val + "')</script>");
            sl = null;
        }
        //是否店铺开放价格
        sl = Sysl.FindAll(p => p.Name == "是否店铺开放价格");
        if (sl != null && sl.Count > 0)
        {
            if (sl[0].Value.ToString() == "0")
            {
                this.kfmoney0.Checked = true;
            }
            else
            {
                this.kfmoney1.Checked = true;
            }

            sl = null;
        }
        else
        {
            this.kfmoney0.Checked = true;
        }

        #endregion

        #region 查询企业物流信息

        List <Hi.Model.BD_ComLogistics> cl = new Hi.BLL.BD_ComLogistics().GetList("", "dr=0 and CompID=" + this.CompID, "");

        if (cl != null && cl.Count > 0)
        {
            string str = string.Empty;
            foreach (Hi.Model.BD_ComLogistics item in cl)
            {
                str += "<i style=\"margin-left:10px;\" title=\"" + item.LogisticsName + "\">" + item.LogisticsName + "</i>";
            }

            this.divlogistics.InnerHtml = str;
        }

        #endregion

        #region 计息设置

        #endregion

        #region 订单完成节点设置
        sl = Sysl.FindAll(p => p.Name == "订单完成节点设置");
        string scriptstr = string.Empty;
        if (sl != null && sl.Count > 0)
        {
            if (sl[0].Value.ToString() == "0")
            {
                scriptstr = "$(\".quan4\").text(\"√\")";
            }
            else if (sl[0].Value.ToString() == "1")
            {
                scriptstr = "$(\".quan4\").text(\"\")";
            }
            else if (sl[0].Value.ToString() == "2")
            {
                scriptstr = "$(\".ddlist li\").eq(2).find(\".quan4\").text(\"√\");$(\".ddlist li\").eq(3).find(\".quan4\").text(\"\");$(\".ddlist li\").eq(4).find(\".quan4\").text(\"\");";
            }
            else if (sl[0].Value.ToString() == "3")
            {
                scriptstr = "$(\".ddlist li\").eq(2).find(\".quan4\").text(\"√\");$(\".ddlist li\").eq(3).find(\".quan4\").text(\"√\");$(\".ddlist li\").eq(4).find(\".quan4\").text(\"\");";
            }
            sl = null;
        }
        else
        {
            scriptstr = "$(\".quan4\").text(\"√\")";
        }
        #endregion
        if (scriptstr != "")
        {
            ClientScript.RegisterStartupScript(this.GetType(), "ddjdsz", "<script>$(function(){" + scriptstr + "})</script>");
        }
    }