Exemplo n.º 1
0
    /// <summary>
    /// //自定义字段
    /// </summary>
    private void GetZiDingYi(Hi.Model.BD_Goods model)
    {
        string html = string.Empty;
        List <Hi.Model.SYS_SysName> l = new Hi.BLL.SYS_SysName().GetList("", "isnull(dr,0)=0 and compId=" + model.CompID + " and name='商品自定义字段'", "");

        if (l.Count > 0)
        {
            if (!Util.IsEmpty(l[0].Value.Trim()))
            {
                string[] valuelist = l[0].Value.Trim().Split(',');
                if (valuelist.Length == 5)
                {
                    html = "<div class=\"li\"><i class=\"bt2\">" + valuelist[0] + ":</i><i >" + model.Value1.Trim() + "</i>&nbsp;&nbsp;&nbsp;&nbsp; <i class=\"bt2\">" + valuelist[1] + ":</i><i >" + model.Value2.Trim() + "</i><br /> <i class=\"bt2\">" + valuelist[2] + ":</i><i >" + model.Value3.Trim() + "</i>&nbsp;&nbsp;&nbsp;&nbsp; <i class=\"bt2\">" + valuelist[3] + ":</i><i >" + model.Value4.Trim() + "</i><br /><i class=\"bt2\">" + valuelist[4] + ":</i><i >" + model.Value5.Trim() + "</i></div>";
                }
                else if (valuelist.Length == 4)
                {
                    html = "<div class=\"li\"><i class=\"bt2\">" + valuelist[0] + ":</i><i >" + model.Value1.Trim() + "</i>&nbsp;&nbsp;&nbsp;&nbsp; <i class=\"bt2\">" + valuelist[1] + ":</i><i >" + model.Value2.Trim() + "</i><br /> <i class=\"bt2\">" + valuelist[2] + ":</i><i >" + model.Value3.Trim() + "</i>&nbsp;&nbsp;&nbsp;&nbsp; <i class=\"bt2\">" + valuelist[3] + ":</i><i >" + model.Value4.Trim() + "</i></div>";
                }
                else if (valuelist.Length == 3)
                {
                    html = "<div class=\"li\"><i class=\"bt2\">" + valuelist[0] + ":</i><i >" + model.Value1.Trim() + "</i>&nbsp;&nbsp;&nbsp;&nbsp; <i class=\"bt2\">" + valuelist[1] + ":</i><i >" + model.Value3.Trim() + "</i><br /> <i class=\"bt2\">" + valuelist[2] + ":</i><i >" + model.Value3.Trim() + "</i></div>";
                }
                else if (valuelist.Length == 2)
                {
                    html = "<div class=\"li\"><i class=\"bt2\">" + valuelist[0] + ":</i><i >" + model.Value1.Trim() + "</i>&nbsp;&nbsp;&nbsp;&nbsp; <i class=\"bt2\">" + valuelist[1] + ":</i><i >" + model.Value2.Trim() + "</i></div>";
                }
                else if (valuelist.Length == 1)
                {
                    html = "<div class=\"li\"><i class=\"bt2\">" + valuelist[0] + ":</i><i >" + model.Value1.Trim() + "</i></div>";
                }
            }
        }
        this.litZiDingYi.Text = html;
    }
Exemplo n.º 2
0
    /// <summary>
    /// 获取订单设置
    /// </summary>
    /// <param name="Name">设置名称</param>
    /// <param name="CompID">厂商ID</param>
    /// <returns>0、不审核,1、审核</returns>
    public static string rdoOrderAudit(string Name, int CompID)
    {
        List <Hi.Model.SYS_SysName> sl = new Hi.BLL.SYS_SysName().GetList("", " CompID=" + CompID + " and Name='" + Name + "' and dr=0", "");

        if (sl != null && sl.Count > 0)
        {
            return(sl[0].Value);
        }
        return("0");
    }
Exemplo n.º 3
0
    /// <summary>
    /// 判断当天登录时服务是否执行
    /// </summary>
    /// <param name="Name"></param>
    /// <returns>0、没有执行, 1、执行</returns>
    public int IsRun(int CompID, string Name)
    {
        int IsExecute = 1;

        string strwhere = string.Empty;

        if (CompID == 0)
        {
            strwhere = " isnull(dr,0)=0 and Name='" + Name + "' ";
        }
        else
        {
            strwhere = "isnull(dr,0)=0 and Name='" + Name + "' and CompID=" + CompID;
        }

        List <Hi.Model.SYS_SysName> LSName = new Hi.BLL.SYS_SysName().GetList("", strwhere, "");

        if (LSName.Count > 0)
        {
            if (DateTime.Now.Date > LSName[0].ts.Date)
            {
                IsExecute    = 0;
                LSName[0].ts = DateTime.Now.Date;
                new Hi.BLL.SYS_SysName().Update(LSName[0]);
            }
        }
        else
        {
            Hi.Model.SYS_SysName model = new Hi.Model.SYS_SysName();
            model.CompID = CompID;
            model.Code   = "";
            model.Name   = Name;
            if (CompID == 0)
            {
                model.Value = "";
            }
            else
            {
                if (Name.Equals("超时未付款自动作废订单"))
                {
                    model.Value = "30";
                }
                else
                {
                    model.Value = "15";
                }
            }
            model.ts         = DateTime.Now.Date.AddDays(-1);
            model.dr         = 0;
            model.modifyuser = 0;
            new Hi.BLL.SYS_SysName().Add(model);
            IsRun(CompID, Name);
        }
        return(IsExecute);
    }
Exemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         List <Hi.Model.SYS_SysName> SysNameList = new Hi.BLL.SYS_SysName().GetList("", " name='搜索热词' and  dr=0 ", "");
         if (SysNameList.Count > 0)
         {
             txt_SelectValue.Value = SysNameList[0].Value;
         }
     }
 }
Exemplo n.º 5
0
 protected void btnSubMit_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(txt_SelectValue.Value))
     {
         int count = txt_SelectValue.Value.Split(',').Length;
         if (txt_SelectValue.Value.Split(',').Length > 6)
         {
             JScript.AlertMsg(this, "最多设置6个热词");
         }
         else
         {
             List <Hi.Model.SYS_SysName> SysNameList = new Hi.BLL.SYS_SysName().GetList("", " name='搜索热词' and  dr=0 ", "");
             if (SysNameList.Count > 0)
             {
                 Hi.Model.SYS_SysName sysname = SysNameList[0];
                 sysname.Value      = txt_SelectValue.Value;
                 sysname.ts         = DateTime.Now;
                 sysname.modifyuser = this.UserID;
                 if (new Hi.BLL.SYS_SysName().Update(sysname))
                 {
                     JScript.AlertMsg(this, "设置成功");
                 }
                 else
                 {
                     JScript.AlertMsg(this, "失败");
                 }
             }
             else
             {
                 Hi.Model.SYS_SysName sysname = new Hi.Model.SYS_SysName();
                 sysname.CompID     = 0;
                 sysname.Code       = "0001";
                 sysname.Name       = "搜索热词";
                 sysname.Value      = txt_SelectValue.Value;
                 sysname.ts         = DateTime.Now;
                 sysname.dr         = 0;
                 sysname.modifyuser = this.UserID;
                 if (new Hi.BLL.SYS_SysName().Add(sysname) > 0)
                 {
                     JScript.AlertMsg(this, "设置成功");
                 }
                 else
                 {
                     JScript.AlertMsg(this, "失败");
                 }
             }
         }
     }
     ClientScript.RegisterStartupScript(this.GetType(), "MSG", "<script>window.parent.location.href=window.parent.location.href; </script>");
 }
Exemplo n.º 6
0
    /// <summary>
    /// 获得最新Code
    /// </summary>
    /// <param name="Name"></param>
    /// <returns></returns>
    public static string GetNewCode(string strName)
    {
        string returnstr = "";

        try
        {
            List <Hi.Model.SYS_SysName> NameModel = new Hi.BLL.SYS_SysName().GetList("", "CompID=0 and Name='" + strName + "'", "");
            if (NameModel != null)
            {
                //string OrgCode = ConfigurationManager.AppSettings["OrgCode"] == null ? "" : ConfigurationManager.AppSettings["OrgCode"].ToString().Trim() + "-";
                //string value = NameModel[0].Value;
                string yyyy = DateTime.Today.Year.ToString().PadLeft(4, '0');
                string mm   = DateTime.Today.Month.ToString().PadLeft(2, '0');
                string dd   = DateTime.Today.Day.ToString().PadLeft(2, '0');

                string codeName = string.Empty;

                codeName = yyyy + mm + dd;

                List <Hi.Model.SYS_SysCode> CodeModel = new Hi.BLL.SYS_SysCode().GetList("", "CompID=0 and CodeName='" + codeName + "'", "");
                if (CodeModel.Count > 0)
                {
                    int    codeValue  = Convert.ToInt32(CodeModel[0].CodeValue);
                    int    newCode    = codeValue + 1;
                    string newCodeStr = "";

                    newCodeStr = codeName + "-" + newCode.ToString().PadLeft(6, '0');
                    //returnstr = OrgCode + value + "-" + newCodeStr;
                    returnstr = "MD-" + newCodeStr;

                    //修改最新值
                    SqlHelper.ExecuteSql(SqlHelper.LocalSqlServer, "update SYS_SysCode set CodeValue=" + newCode + " where CodeName='" + codeName + "'");
                }
                else
                {
                    string newCodeStr = "";
                    newCodeStr = codeName + "-000001";

                    //returnstr = OrgCode + value + "-" + newCodeStr;
                    returnstr = "MD-" + newCodeStr;
                    //插入数据
                    SqlHelper.ExecuteSql(SqlHelper.LocalSqlServer, "insert into SYS_SysCode(CompID,CodeName,CodeValue,ts,modifyuser) values(0,'" + codeName + "',1,'" + DateTime.Now + "',0)");
                }
            }
        }
        catch { }
        return(returnstr);
    }
Exemplo n.º 7
0
    public string GetDay(int compID, string strWhat)
    {
        string strwhere = string.Empty;

        if (compID == 0)
        {
            strwhere = " isnull(dr,0)=0 and Name='" + strWhat + "' ";
        }
        else
        {
            strwhere = "isnull(dr,0)=0 and Name='" + strWhat + "' and CompID=" + compID;
        }
        List <Hi.Model.SYS_SysName> LSName = new Hi.BLL.SYS_SysName().GetList("", strwhere, "");

        return(LSName.Count > 0 ? LSName[0].Value : "0");
    }
Exemplo n.º 8
0
    /// <summary>
    /// 商品标签
    /// </summary>
    /// <returns></returns>
    public void GetGoodsLabels(int keyId)
    {
        string[]      list            = { };
        StringBuilder str             = new StringBuilder();
        List <Hi.Model.SYS_SysName> l = new Hi.BLL.SYS_SysName().GetList("", "isnull(dr,0)=0 and compid=" + this.CompID + " and name='商品标签管理'", "");

        if (l.Count > 0)
        {
            foreach (Hi.Model.SYS_SysName item in l)
            {
                string labelname = item.Value;
                if (labelname.Trim() != "")
                {
                    list = labelname.Split(',');
                }
            }
            List <Hi.Model.BD_GoodsLabels> ll = new Hi.BLL.BD_GoodsLabels().GetList("", "isnull(dr,0)=0 and compid=" + this.CompID + " and goodsId=" + keyId, "");
            for (int i = 0; i < list.Length; i++)
            {
                if (keyId != 0)
                {
                    if (ll.Count > 0)
                    {
                        int z = 0;//不相同的情况
                        foreach (Hi.Model.BD_GoodsLabels item in ll)
                        {
                            if (list[i] == item.LabelName)
                            {
                                str.Append("<label class=\"productLabelItem checked\"><input type=\"checkbox\" name=\"labelcheckbox\" value=\"" + list[i] + "\" style=\"display: none\" checked=\"checked\" />" + list[i] + "</label></ItemTemplate>");
                                break;
                            }
                            z++;
                        }
                        if (z == ll.Count)
                        {
                            str.Append("<label class=\"productLabelItem\"><input type=\"checkbox\" name=\"labelcheckbox\" value=\"" + list[i] + "\" style=\"display: none\" />" + list[i] + "</label></ItemTemplate>");
                        }
                    }
                }
                else
                {
                    str.Append("<label class=\"productLabelItem\"><input type=\"checkbox\" name=\"labelcheckbox\" value=\"" + list[i] + "\" style=\"display: none\" />" + list[i] + "</label></ItemTemplate>");
                }
            }
        }
        this.DivLabel.InnerHtml = str.ToString();
    }
Exemplo n.º 9
0
    /// <summary>
    /// //自定义字段
    /// </summary>
    private void GetZiDingYi(Hi.Model.BD_Goods model)
    {
        string html = string.Empty;
        List <Hi.Model.SYS_SysName> l = new Hi.BLL.SYS_SysName().GetList("", "isnull(dr,0)=0 and compId=" + model.CompID + " and name='商品自定义字段'", "");

        if (l.Count > 0)
        {
            if (!Util.IsEmpty(l[0].Value.Trim()))
            {
                string[] valuelist = l[0].Value.Trim().Split(',');

                for (int i = 0; i < valuelist.Length; i++)
                {
                    string strvalue = string.Empty;
                    if (i == 0)
                    {
                        strvalue = model.Value1.Trim();
                    }
                    else if (i == 1)
                    {
                        strvalue = model.Value2.Trim();
                    }
                    else if (i == 2)
                    {
                        strvalue = model.Value3.Trim();
                    }
                    else if (i == 3)
                    {
                        strvalue = model.Value4.Trim();
                    }
                    else if (i == 4)
                    {
                        strvalue = model.Value5.Trim();
                    }
                    if (Util.IsEmpty(strvalue))
                    {
                        continue;
                    }
                    html += "<div class=\"li\"><div class=\"t\" style=\"margin-top: -7px;\">" + valuelist[i] + ":</div><div class=\"n zidingyi\">" + strvalue + "</div></div>";
                }

                // }
            }
        }
        this.litZiDingYi.InnerHtml = html;
    }
Exemplo n.º 10
0
    //绑定商品数据
    public void BindData()
    {
        string sysNameWhere = string.Format(" CompID={0} and Name='是否店铺开放价格'", Request["Comid"].ToInt(0));
        List <Hi.Model.SYS_SysName> Sysl = new Hi.BLL.SYS_SysName().GetList("", sysNameWhere, "");

        if (Sysl.Count > 0)
        {
            kfmoney = Sysl[0].Value == "1" ? true : false;
        }

        string    Sqlwhere     = SearchWhere();
        int       pageCount    = 0;
        int       Counts       = 0;
        string    JoinTableStr = "  BD_Goods left join (select  ROW_NUMBER() over(PARTITION BY GoodsID order by bp.createdate desc) rowid,  GoodsID id,bp.id  Proid,bp.Type,bp.ProType,bp.Discount,bpd.GoodsPrice from BD_PromotionDetail bpd  join BD_Promotion Bp on  bp.ID=bpd.ProID and bp.IsEnabled=1 and bp.dr=0 and Bp.CompID=" + ViewState["Compid"] + " and '" + DateTime.Now + "' between ProStartTime and  dateadd(D,1,ProEndTime))b   on BD_Goods.id=b.id and b.rowid=1  left join BD_DisCollect Bdc on BD_Goods.id=Bdc.GoodsID and Bdc.DisID=" + ViewState["DisID"] + "  and Bdc.dr=0 ";
        DataTable ListGoods    = new Hi.BLL.BD_Goods().GetList(Pager_List.PageSize, Pager_List.CurrentPageIndex, " b.Type desc,Bdc.id desc ,Ispic desc, BD_Goods.isindex desc ,BD_Goods.CreateDate ", true, " (case when isnull(BD_Goods.pic,'')='' then 0 else 1 end) Ispic,BD_Goods.CreateDate, BD_Goods.id,BD_Goods.GoodsName,b.Type ,BD_Goods.isindex,b.Proid,BD_Goods.Pic,Bdc.id  BdcID,dbo.GetPMInfoMation(b.type,b.ProType,b.Discount,b.GoodsPrice) ProInfoMation,IsLS,LSPrice,SalePrice", JoinTableStr, Sqlwhere, out pageCount, out Counts, " ,(case when isnull(BD_Goods.pic2,'')='' then 0 else 1 end) Ispic ,b.Type ,Bdc.id , BD_Goods.CreateDate,BD_Goods.isindex ");

        Rpt_GoodsBig.DataSource = ListGoods;
        Rpt_GoodsBig.DataBind();
        Pager_List.RecordCount            = Counts;
        Pager_List.TextBeforePageIndexBox = "<i class='tf2'>共" + Pager_List.PageCount + "页</i> <span class='tf2'>到第:</span>";
        page = Pager_List.CurrentPageIndex.ToString();
        if (Pager_List.CurrentPageIndex == 1)
        {
            PagePrev.Style.Add("background-color", "rgb(234,234,234) ");
            PagePrev.Attributes.Add("disbled", "");
        }
        else
        {
            PagePrev.Style.Remove("background-color");
            PagePrev.Attributes.Remove("disbled");
        }
        if (Pager_List.CurrentPageIndex == Pager_List.PageCount)
        {
            PageNext.Style.Add("background-color", "rgb(234,234,234) ");
            PageNext.Attributes.Add("disbled", "");
        }
        else
        {
            PageNext.Style.Remove("background-color");
            PageNext.Attributes.Remove("disbled");
        }
    }
Exemplo n.º 11
0
    /// <summary>
    /// 获取价格
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public string GetProPrice2(string values, string comPid, string goodsId)
    {
        string sysNameWhere = string.Format(" CompID={0} and Name='是否店铺开放价格'", Request["Comid"].ToInt(0));
        List <Hi.Model.SYS_SysName> Sysl = new Hi.BLL.SYS_SysName().GetList("", sysNameWhere, "");

        string     str   = "暂无价格";
        LoginModel model = HttpContext.Current.Session["UserModel"] as LoginModel;

        Hi.Model.BD_Goods goodsModel = new Hi.BLL.BD_Goods().GetModel(Convert.ToInt32(goodsId));
        if (model == null || goodsModel.CompID != model.CompID)
        {
            if (Sysl.Count > 0)
            {
                if (Sysl[0].Value != "1")
                {
                    if (goodsModel.IsLS != 0)
                    {
                        return(goodsModel.LSPrice.ToString("#0.00"));
                    }
                    return("代理商可见");
                }
            }
            else
            {
                if (goodsModel.IsLS != 0)
                {
                    return(goodsModel.LSPrice.ToString("#0.00"));
                }
                return("代理商可见");
            }
        }
        List <Hi.Model.BD_GoodsInfo> lll = new Hi.BLL.BD_GoodsInfo().GetList("", "isnull(dr,0)=0 and isoffline=1 and compId=" + comPid + " and goodsid=" + goodsId, "");

        if (lll.Count != 0)
        {
            return(BLL.Common.GetGoodsPrice(Convert.ToInt32(comPid), Convert.ToInt32(comPid), Convert.ToInt32(lll[0].ID)).ToString("0.00"));
        }
        return("站务价格");
    }
Exemplo n.º 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            List <Hi.Model.SYS_SysName> SysNameList = new Hi.BLL.SYS_SysName().GetList("Value", " name='搜索热词' and  dr=0 ", "");
            if (SysNameList.Count > 0)
            {
                List <string> valuelist = SysNameList[0].Value.Split(',').ToList();
                StringBuilder sb        = new StringBuilder();
                int           count     = 0;
                foreach (var item in valuelist)
                {
                    count++;
                    if (count == 1)
                    {
                        sb.Append(" <a href =\"goodslist_0_" + item + ".html\" style=\"color:red\">" + item + "</a>");
                    }
                    else
                    {
                        sb.Append(" <a href =\"goodslist_0_" + item + ".html\">" + item + "</a>");
                    }
                }
                SelectValue.InnerHtml = sb.ToString();
            }
            if (!IsIndex)
            {
                leftNav.Style.Add("display", "none");
            }

            List <Hi.Model.SYS_GType> gType = new Hi.BLL.SYS_GType().GetList("", " ParentId=0 and IsEnabled=1 and ISNULL(dr,0)=0", "");
            if (gType != null && gType.Count > 0)
            {
                this.rpt_Gtype.DataSource = gType;
                this.rpt_Gtype.DataBind();
            }
        }
    }
Exemplo n.º 13
0
    /// <summary>
    /// 保存系统设置信息
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Settings(string str)
    {
        JsonData JInfo = JsonMapper.ToObject(str);

        string bind = "{\"ds\":\"1\",\"prompt\":\"提交失败\"}";

        if (JInfo.Count < 0)
        {
            Response.Write(bind);
            Response.End();
        }

        StringBuilder strSql = new StringBuilder();

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

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

        try
        {
            //查询该企业的设置
            List <Hi.Model.SYS_SysName> Sysl = new Hi.BLL.SYS_SysName().GetList("", " CompID=" + CompID, "");
            int d = 0;

            //判断企业的是否有设置
            if (Sysl != null && Sysl.Count > 0)
            {
                for (int i = 0; i <= JInfo.Count - 1; i++)
                {
                    JsonData j = JInfo[i];
                    //系统设置的标题
                    string key = Common.NoHTML(j["key"].ToString());
                    //系统设置的值
                    string val = Common.NoHTML(j["val"].ToString());


                    //if (key == "商品是否启用库存")
                    //{
                    //    List<Hi.Model.DIS_Order> l = new Hi.BLL.DIS_Order().GetList("", " compID=" + CompID + " and OState in(1,2) and isnull(dr,0)=0", "");
                    //    if (l != null && l.Count > 0)
                    //    {
                    //        d = 1;
                    //        continue;
                    //    }
                    //}

                    List <Hi.Model.SYS_SysName> sl = Sysl.FindAll(p => p.Name == key);
                    if (sl != null && sl.Count > 0)
                    {
                        strSql.AppendFormat("update SYS_SysName set Value='{0}',ts='{1}' where Name='{2}' and CompID={3};", val, DateTime.Now.AddDays(-1), key, CompID);
                    }
                    else
                    {
                        strSql.AppendFormat("INSERT INTO [SYS_SysName]([CompID],[Code],[Name],[Value],[ts],[dr],[modifyuser])VALUES({0},'','{1}','{2}','{3}',0,{4});", CompID, key, val, DateTime.Now.AddDays(-1), UserID);
                    }
                }
            }
            else
            {
                for (int i = 0; i <= JInfo.Count - 1; i++)
                {
                    JsonData j = JInfo[i];

                    //系统设置的标题
                    string key = Common.NoHTML(j["key"].ToString());
                    //系统设置的值
                    string val = Common.NoHTML(j["val"].ToString());

                    strSql.AppendFormat("INSERT INTO [SYS_SysName]([CompID],[Code],[Name],[Value],[ts],[dr],[modifyuser])VALUES({0},'','{1}','{2}','{3}',0,{4});", CompID, key, val, DateTime.Now.AddDays(-1), UserID);
                }
            }

            SqlCommand cmd = new SqlCommand(strSql.ToString(), Connection, TranSaction);
            cmd.CommandType = CommandType.Text;
            int rowsAffected = SqlHelper.GetInt(cmd.ExecuteNonQuery().ToString());
            if (rowsAffected > 0)
            {
                TranSaction.Commit();

                //if (d == 1)
                //    bind = "{\"ds\":\"0\",\"prompt\":\"订单没有处理完成,修改商品启用库存失败!\"}";
                //else
                bind = "{\"ds\":\"0\",\"prompt\":\"提交成功!\"}";
            }
            else
            {
                TranSaction.Rollback();
                bind = "{\"ds\":\"1\",\"prompt\":\"提交失败!\"}";
            }
        }
        catch (Exception ex)
        {
            TranSaction.Rollback();
            bind = "{\"ds\":\"1\",\"prompt\":\"提交失败!\"}";
        }
        finally
        {
            Connection.Dispose();

            Response.Write(bind);

            Response.End();
        }
    }
Exemplo n.º 14
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        if (KeyID > 0)
        {
            bool Audit = false;
            Hi.Model.BD_Company comp = new Hi.BLL.BD_Company().GetModel(KeyID);
            if (comp != null)
            {
                if (comp.dr == 1)
                {
                    JScript.AlertMsg(this, "厂商不存在!。");
                    return;
                }
                string         str  = string.Empty;
                SqlTransaction Tran = null;
                try
                {
                    if (comp.AuditState == 2)
                    {
                        Audit = true;
                    }
                    if (Common.CompExistsAttribute("CompName", txtCompName.Value.Trim(), KeyID.ToString()))
                    {
                        JScript.AlertMsg(this, "该厂商名称已存在。");
                        return;
                    }
                    string CompAddr = hidProvince.Value.Trim();
                    if (!string.IsNullOrWhiteSpace(hidCity.Value.Trim()) && hidCity.Value.Trim() != "选择市")
                    {
                        CompAddr += "-" + hidCity.Value.Trim();
                    }
                    if (!string.IsNullOrWhiteSpace(hidArea.Value.Trim()) && hidArea.Value.Trim() != "选择区")
                    {
                        CompAddr += "-" + hidArea.Value.Trim();
                    }
                    comp.CompAddr = CompAddr;
                    comp.CompName = Common.NoHTML(txtCompName.Value.Trim());
                    comp.Capital  = Capital.Value.Trim();
                    comp.CompType = Convert.ToInt32(CompType.SelectedValue);
                    comp.Tel      = Common.NoHTML(txtTel.Value.Trim());
                    if (txtPrincipal.Value.Trim() != "")
                    {
                        comp.Principal = Common.NoHTML(txtPrincipal.Value.Trim());
                    }
                    else
                    {
                        comp.Principal = Common.NoHTML(txtUserTrueName.Value.Trim());
                    }
                    comp.Legal = Common.NoHTML(txtLegal.Value.Trim());
                    if (txtPhone.Value.Trim() != "")
                    {
                        comp.Phone = Common.NoHTML(txtPhone.Value.Trim());
                    }
                    else
                    {
                        comp.Phone = Common.NoHTML(txtUserPhone.Value.Trim());
                    }
                    comp.ShortName  = Common.NoHTML(txtShotName.Value.Trim());
                    comp.Zip        = Common.NoHTML(txtZip.Value.Trim());
                    comp.Identitys  = Common.NoHTML(txtIdentitys.Value.Trim());
                    comp.Licence    = Common.NoHTML(txtLicence.Value.Trim());
                    comp.LegalTel   = Common.NoHTML(txtLegalTel.Value.Trim());
                    comp.ManageInfo = Common.NoHTML(txtInfo.Value.Trim());
                    comp.Fax        = Common.NoHTML(txtFax.Value.Trim());
                    comp.Account    = Common.NoHTML(txtAccount.Value.Trim());
                    comp.Address    = Common.NoHTML(txtAddress.Value.Trim());
                    comp.IndID      = txtIndusName.SelectedValue.ToInt(0);
                    comp.Trade      = txtIndusName.Items[txtIndusName.SelectedIndex].Text;
                    comp.AuditState = 2;
                    comp.AuditDate  = DateTime.Now;//add by hgh 审核日期
                    comp.AuditUser  = UserID.ToString();

                    comp.ts               = DateTime.Now;
                    comp.modifyuser       = UserID;
                    comp.OrganizationCode = Common.NoHTML(txtOrcode.Value.Trim());
                    comp.IsEnabled        = rdEbleYes.Checked ? 1 : 0;
                    comp.HotShow          = rdHotShowYes.Checked ? 1 : 0;
                    comp.FirstShow        = Convert.ToInt32(ddlChkShow.SelectedValue);// rdFirstShowYes.Checked ? 1 : 0;
                    comp.Remark           = Common.NoHTML(txtRemark.Value.Trim());
                    comp.Erptype          = ddlErptype.SelectedValue.ToInt(0);
                    //企业编号  add by hgh
                    comp.CompCode = Common.CreateCode(KeyID);
                    if (HidFfileName.Value != "")
                    {
                        if (string.IsNullOrEmpty(comp.Attachment))
                        {
                            comp.Attachment = HidFfileName.Value;
                        }
                        else
                        {
                            comp.Attachment += "," + HidFfileName.Value;
                        }
                    }
                    List <Hi.Model.SYS_CompUser> ListComp = new Hi.BLL.SYS_CompUser().GetList("", " dr=0 and Ctype=1 and Utype=4 and CompID=" + KeyID + "", "");
                    if (ListComp.Count > 0)
                    {
                        Tran  = DBUtility.SqlHelper.CreateStoreTranSaction();
                        Audit = ListComp[0].IsAudit == 2;
                        if (Audit)
                        {
                            List <Hi.Model.BD_Distributor> dis = new Hi.BLL.BD_Distributor().GetList("", " isnull(dr,0)=0 and compid=" + KeyID + "", "");
                            foreach (Hi.Model.BD_Distributor model2 in dis)
                            {
                                model2.IsEnabled  = comp.IsEnabled;
                                model2.ts         = DateTime.Now;
                                model2.modifyuser = UserID;
                                new Hi.BLL.BD_Distributor().Update(model2, Tran);
                            }
                            new Hi.BLL.BD_Company().Update(comp, Tran);
                            List <Hi.Model.SYS_Users> user = new Hi.BLL.SYS_Users().GetList("", " isnull(dr,0)=0 and id=" + ListComp[0].UserID + " ", "");
                            if (user.Count > 0)
                            {
                                user[0].TrueName   = Common.NoHTML(txtUserTrueName.Value.Trim());
                                user[0].ts         = DateTime.Now;
                                user[0].modifyuser = UserID;
                                new Hi.BLL.SYS_Users().Update(user[0], Tran);
                            }
                            Tran.Commit();
                            Response.Redirect("CompInfo.aspx?go=1&KeyID=" + KeyID + "&type=5", false);
                        }
                        else
                        {
                            if (UserType == 3 || UserType == 4)
                            {
                                comp.OrgID      = OrgID;
                                comp.SalesManID = SalesManID;
                            }
                            if ((new Hi.BLL.BD_Company().Update(comp, Tran)))
                            {
                                //新增数据字典
                                Hi.Model.BD_DefDoc doc = new Hi.Model.BD_DefDoc();
                                doc.CompID     = KeyID;
                                doc.AtCode     = "";
                                doc.AtName     = "计量单位";
                                doc.ts         = DateTime.Now;
                                doc.modifyuser = UserID;
                                doc.dr         = 0;
                                List <Hi.Model.BD_DefDoc> ll = new Hi.BLL.BD_DefDoc().GetList("", "isnull(dr,0)=0 and compid=" + KeyID + " and atname='计量单位'", "", Tran);
                                if (ll.Count == 0)
                                {
                                    new Hi.BLL.BD_DefDoc().Add(doc, Tran);
                                }

                                //代理商加盟是否需要审核
                                Hi.Model.SYS_SysName sysname = new Hi.Model.SYS_SysName();
                                sysname.CompID     = KeyID;
                                sysname.Code       = "";
                                sysname.Name       = "代理商加盟是否需要审核";
                                sysname.Value      = "0";
                                sysname.ts         = DateTime.Now;
                                sysname.modifyuser = UserID;
                                List <Hi.Model.SYS_SysName> sysl = new Hi.BLL.SYS_SysName().GetList("", "Name='代理商加盟是否需要审核' and CompID=" + KeyID, "", Tran);
                                if (sysl != null && sysl.Count == 0)
                                {
                                    new Hi.BLL.SYS_SysName().Add(sysname, Tran);
                                }

                                //费用科目
                                Hi.Model.BD_DefDoc doc1 = new Hi.Model.BD_DefDoc();
                                doc1.CompID     = KeyID;
                                doc1.AtCode     = "";
                                doc1.AtName     = "费用科目";
                                doc1.ts         = DateTime.Now;
                                doc1.modifyuser = UserID;
                                doc1.dr         = 0;
                                List <Hi.Model.BD_DefDoc> ll1 = new Hi.BLL.BD_DefDoc().GetList("", "isnull(dr,0)=0 and compid=" + KeyID + " and atname='费用科目'", "", Tran);
                                if (ll1.Count == 0)
                                {
                                    new Hi.BLL.BD_DefDoc().Add(doc1, Tran);
                                }


                                doc.CompID     = KeyID;
                                doc.AtCode     = "";
                                doc.AtName     = "代理商等级";
                                doc.ts         = DateTime.Now;
                                doc.modifyuser = UserID;
                                doc.dr         = 0;
                                List <Hi.Model.BD_DefDoc> lll = new Hi.BLL.BD_DefDoc().GetList("", "isnull(dr,0)=0 and compid=" + KeyID + " and atname='代理商等级'", "", Tran);
                                if (lll.Count == 0)
                                {
                                    new Hi.BLL.BD_DefDoc().Add(doc, Tran);
                                }
                                List <Hi.Model.SYS_Role> l = new Hi.BLL.SYS_Role().GetList("", "isnull(dr,0)=0 and isenabled=1 and compid=" + KeyID + " and RoleName='企业管理员'", "");
                                if (l.Count == 0)
                                {
                                    //新增角色(企业管理员)
                                    Hi.Model.SYS_Role role = new Hi.Model.SYS_Role();
                                    role.CompID       = KeyID;
                                    role.RoleName     = "企业管理员";
                                    role.IsEnabled    = 1;
                                    role.SortIndex    = "1";
                                    role.CreateDate   = DateTime.Now;
                                    role.CreateUserID = UserID;
                                    role.ts           = DateTime.Now;
                                    role.modifyuser   = UserID;
                                    role.dr           = 0;
                                    int Roid = new Hi.BLL.SYS_Role().Add(role, Tran);

                                    //新增角色用户
                                    Hi.Model.SYS_RoleUser RoleUser = new Hi.Model.SYS_RoleUser();
                                    RoleUser.FunType    = 1;
                                    RoleUser.UserID     = ListComp[0].UserID;
                                    RoleUser.RoleID     = Roid;
                                    RoleUser.IsEnabled  = true;
                                    RoleUser.CreateUser = this.UserID.ToString();
                                    RoleUser.CreateDate = DateTime.Now;
                                    RoleUser.ts         = DateTime.Now;
                                    RoleUser.dr         = 0;
                                    new Hi.BLL.SYS_RoleUser().Add(RoleUser, Tran);

                                    //修改用户对应的角色
                                    List <Hi.Model.SYS_Users> ListUser = new Hi.BLL.SYS_Users().GetList("", " isnull(dr,0)=0 and id=" + ListComp[0].UserID + " ", "");
                                    if (ListUser.Count > 0)
                                    {
                                        ListUser[0].TrueName   = Common.NoHTML(txtUserTrueName.Value.Trim());
                                        ListUser[0].ts         = DateTime.Now;
                                        ListUser[0].modifyuser = UserID;
                                        ListUser[0].AuditState = 2;
                                        new Hi.BLL.SYS_Users().Update(ListUser[0], Tran);
                                    }
                                    ListComp[0].IsAudit    = 2;
                                    ListComp[0].modifyuser = UserID;
                                    ListComp[0].ts         = DateTime.Now;
                                    ListComp[0].RoleID     = Roid;
                                    new Hi.BLL.SYS_CompUser().Update(ListComp[0], Tran);

                                    Hi.Model.BD_CompNews CNew = new Hi.Model.BD_CompNews();
                                    CNew.NewsTitle    = "欢迎登录" + ConfigurationManager.AppSettings["PhoneSendName"].ToString() + "平台";
                                    CNew.NewsContents = "”" + ConfigurationManager.AppSettings["PhoneSendName"].ToString() + "”平台为企业和代理商之间搭建了电子商务平台,通过企业入驻及代理商的加盟,形成覆盖全行业的线上销售网络。同时,充分利用平台信息化整合优势,帮助入驻企业销售模式电商化改造,以及为代理商信息化建设提供有力支持。另外,还将为供应链上的相关各方提供全渠道的结算服务以及授信融资等多项互联网金融服务。";
                                    CNew.IsEnabled    = 1;
                                    CNew.IsTop        = 0;
                                    CNew.NewsType     = 2;
                                    CNew.ShowType     = "1,2";
                                    CNew.CompID       = KeyID;
                                    CNew.CreateDate   = DateTime.Now;
                                    CNew.CreateUserID = UserID;
                                    CNew.ts           = DateTime.Now;
                                    CNew.modifyuser   = UserID;
                                    new Hi.BLL.BD_CompNews().Add(CNew, Tran);

                                    //新增角色权限表
                                    Hi.Model.SYS_RoleSysFun rolesys = null;
                                    //add by hgh   增加了:and funcode<>'1030'
                                    List <Hi.Model.SYS_SysFun> funList = new Hi.BLL.SYS_SysFun().GetList("", " Type=1 and funcode<>'1030'", "");
                                    foreach (Hi.Model.SYS_SysFun sys in funList)
                                    {
                                        rolesys              = new Hi.Model.SYS_RoleSysFun();
                                        rolesys.CompID       = KeyID;
                                        rolesys.RoleID       = Roid;
                                        rolesys.FunCode      = sys.FunCode;
                                        rolesys.FunName      = sys.FunName;
                                        rolesys.IsEnabled    = 1;
                                        rolesys.CreateUserID = UserID;
                                        rolesys.CreateDate   = DateTime.Now;
                                        rolesys.ts           = DateTime.Now;
                                        rolesys.modifyuser   = UserID;
                                        new Hi.BLL.SYS_RoleSysFun().Add(rolesys, Tran);
                                    }

                                    //新增代理商分类
                                    Hi.Model.BD_DisType distype = new Hi.Model.BD_DisType();
                                    distype.CompID       = KeyID;
                                    distype.TypeName     = "全部";
                                    distype.ParentId     = 0;
                                    distype.TypeCode     = "1001";
                                    distype.SortIndex    = "1000";
                                    distype.IsEnabled    = 0;
                                    distype.CreateUserID = UserID;
                                    distype.CreateDate   = DateTime.Now;
                                    distype.ts           = DateTime.Now;
                                    distype.modifyuser   = UserID;
                                    distype.dr           = 0;
                                    new Hi.BLL.BD_DisType().Add(distype, Tran);
                                    Tran.Commit();

                                    //审核成功   添加一条默认的商品分类 -开始

                                    string Typecode = "";//商品大类
                                    //Hi.Model.SYS_GType gtype = new Hi.BLL.SYS_GType().GetList(" top 1 *", " Deep=3  and FullCode like '"+ Typecode + "-%' and IsEnabled=1 and dr=0 ", " parentid,ID")[0];
                                    //Hi.Model.BD_GoodsCategory DisType = new Hi.Model.BD_GoodsCategory();

                                    //DisType.Code = NewCategoryCode("1");
                                    //DisType.Deep = 1;
                                    //DisType.ParCode = "";
                                    //DisType.ParentId = 0;
                                    //DisType.CompID = KeyID;
                                    //DisType.CategoryName = "默认";
                                    //DisType.GoodsTypeID = gtype.ID;
                                    //DisType.SortIndex = "1000";
                                    //DisType.CreateDate = DateTime.Now;
                                    //DisType.CreateUserID = 0;
                                    //DisType.IsEnabled = 1;
                                    //DisType.ts = DateTime.Now;
                                    //DisType.modifyuser = 0;
                                    //SqlTransaction trans = SqlHelper.CreateStoreTranSaction();
                                    //try
                                    //{
                                    //    int countID = 0;
                                    //    if ((countID = new Hi.BLL.BD_GoodsCategory().Add(DisType, trans)) > 0)
                                    //    {
                                    //        List<Hi.Model.BD_Goods> gList = new Hi.BLL.BD_Goods().GetList("", " CategoryID=''", "");
                                    //        if (gList != null && gList.Count > 0)
                                    //        {
                                    //            foreach (var bdGoodse in gList)
                                    //            {
                                    //                bdGoodse.CategoryID = countID;
                                    //                new Hi.BLL.BD_Goods().Update(bdGoodse, trans);
                                    //            }
                                    //        }
                                    //        trans.Commit();

                                    //    }

                                    //}
                                    //catch (Exception ex)
                                    //{
                                    //    Tiannuo.LogHelper.LogHelper.Error("Error", ex);
                                    //    if (trans != null)
                                    //    {
                                    //        if (trans.Connection != null)
                                    //        {
                                    //            trans.Rollback();
                                    //        }
                                    //    }
                                    //    return;
                                    //}
                                    //finally
                                    //{
                                    //    SqlHelper.ConnectionClose();
                                    //    if (trans != null)
                                    //    {
                                    //        if (trans.Connection != null)
                                    //        {
                                    //            trans.Connection.Close();
                                    //        }
                                    //    }
                                    //}
                                    //审核成功   添加一条默认的商品分类 -结束



                                    DBUtility.GetPhoneCode getphonecode = new DBUtility.GetPhoneCode();
                                    str = getphonecode.ReturnSTRS(ListUser[0].Phone, comp.CompName, ListUser[0].UserName);
                                    if (str != "Success")
                                    {
                                        JScript.AlertMsgMo(this, "审核通过的通知短信发送失败!请自行发送短信通知企业。", "function(){ window.location.href='CompInfo.aspx?go=1&KeyID=" + KeyID + "&type=" + Request.QueryString["type"] + "" + "'; }");
                                    }
                                    else
                                    {
                                        JScript.AlertMsgMo(this, "审核成功", "function(){ window.location.href='CompInfo.aspx?go=1&KeyID=" + KeyID + "&type=5'; }");
                                    }
                                }
                                else
                                {
                                    ListComp[0].IsAudit    = 2;
                                    ListComp[0].modifyuser = UserID;
                                    ListComp[0].ts         = DateTime.Now;
                                    new Hi.BLL.SYS_CompUser().Update(ListComp[0], Tran);
                                    Hi.Model.SYS_Users           user  = null;
                                    List <Hi.Model.SYS_CompUser> User2 = new Hi.BLL.SYS_CompUser().GetList("", " dr=0 and utype=4 and CompID=" + KeyID + "", "");
                                    if (User2.Count > 0)
                                    {
                                        user = new Hi.BLL.SYS_Users().GetModel(User2[0].UserID);
                                    }
                                    Tran.Commit();

                                    // 发短信通知
                                    DBUtility.GetPhoneCode getphonecode = new DBUtility.GetPhoneCode();
                                    getphonecode.GetUser(ConfigurationManager.AppSettings["PhoneCodeAccount"].ToString(), ConfigurationManager.AppSettings["PhoneCodePwd"].ToString());
                                    str = getphonecode.ReturnSTRS(user.Phone, comp.CompName, user.UserName);
                                    if (str != "Success")
                                    {
                                        JScript.AlertMsgMo(this, "审核通过的通知短信发送失败!请自行发送短信通知企业。", "function(){ window.location.href='CompInfo.aspx?go=1&KeyID=" + KeyID + "&type=" + Request.QueryString["type"] + "" + "'; }");
                                    }
                                    else
                                    {
                                        JScript.AlertMsgMo(this, "审核成功", "function(){ window.location.href='CompInfo.aspx?go=1&KeyID=" + KeyID + "&type=5'; }");
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        JScript.AlertMsg(this, "用户明细数据异常!。");
                        return;
                    }
                }
                catch (Exception ex)
                {
                    Tiannuo.LogHelper.LogHelper.Error("Error", ex);
                    if (Tran != null)
                    {
                        if (Tran.Connection != null)
                        {
                            Tran.Rollback();
                        }
                    }
                    JScript.AlertMsgMo(this, "审核失败", "function(){ window.location.href=window.location.href; }");
                }
                finally
                {
                    DBUtility.SqlHelper.ConnectionClose();
                }
            }
            else
            {
                JScript.AlertMsg(this, "厂商不存在!。");
                return;
            }


            //cust by ggh 20180327 begin  审核通过时,默认给核心企业设置手续费

            Settings(KeyID);

            //cust by ggh 20180327  end  审核通过时,默认给核心企业设置手续费
        }
        else
        {
            if (Common.GetUserExists(txtUsername.Value.Trim()))
            {
                JScript.AlertMsg(this, "该登录帐号已存在。");
                return;
            }
            if (Common.CompExistsAttribute("CompName", txtCompName.Value.Trim()))
            {
                JScript.AlertMsg(this, "该厂商名称已存在。");
                return;
            }
            Regex Phonereg = new Regex("^0?1[0-9]{10}$");
            if (!Phonereg.IsMatch(txtUserPhone.Value.Trim()))
            {
                JScript.AlertMsg(this, "手机号码格式错误!");
                return;
            }
            if (Common.GetUserExists("Phone", txtUserPhone.Value.Trim()))
            {
                JScript.AlertMsg(this, "手机号码已被注册!");
                return;
            }
            Hi.Model.BD_Company comp = new Hi.Model.BD_Company();
            if (UserType == 3 || UserType == 4)
            {
                comp.OrgID      = OrgID;
                comp.SalesManID = SalesManID;
            }
            comp.CompName = Common.NoHTML(txtCompName.Value.Trim());
            comp.Capital  = Capital.Value.Trim();
            comp.CompType = Convert.ToInt32(CompType.SelectedValue);
            comp.Tel      = Common.NoHTML(txtTel.Value.Trim());
            if (txtPrincipal.Value.Trim() != "")
            {
                comp.Principal = Common.NoHTML(txtPrincipal.Value.Trim());
            }
            else
            {
                comp.Principal = Common.NoHTML(txtUserTrueName.Value.Trim());
            }
            comp.Legal    = Common.NoHTML(txtLegal.Value.Trim());
            comp.LegalTel = Common.NoHTML(txtLegalTel.Value.Trim());
            if (txtPhone.Value.Trim() != "")
            {
                comp.Phone = Common.NoHTML(txtPhone.Value.Trim());
            }
            else
            {
                comp.Phone = Common.NoHTML(txtUserPhone.Value.Trim());
            }
            comp.ShortName        = Common.NoHTML(txtShotName.Value.Trim());
            comp.Zip              = Common.NoHTML(txtZip.Value.Trim());
            comp.Identitys        = Common.NoHTML(txtIdentitys.Value.Trim());
            comp.Licence          = Common.NoHTML(txtLicence.Value.Trim());
            comp.ManageInfo       = Common.NoHTML(txtInfo.Value.Trim());
            comp.Fax              = Common.NoHTML(txtFax.Value.Trim());
            comp.OrganizationCode = Common.NoHTML(txtOrcode.Value.Trim());
            comp.Trade            = txtIndusName.Items[txtIndusName.SelectedIndex].Text;
            comp.Account          = Common.NoHTML(txtAccount.Value.Trim());
            comp.Attachment       = HidFfileName.Value;
            comp.Address          = Common.NoHTML(txtAddress.Value.Trim());
            comp.CustomCompinfo   = "本公司产品种类丰富、质量优良、价格公道、服务周到。感谢您长期的支持与厚爱,您的满意是我们最高的追求,我们将竭诚为您提供优质、贴心的服务!";

            string CompAddr = hidProvince.Value.Trim();
            if (!string.IsNullOrWhiteSpace(hidCity.Value.Trim()) && hidCity.Value.Trim() != "选择市")
            {
                CompAddr += "-" + hidCity.Value.Trim();
            }
            if (!string.IsNullOrWhiteSpace(hidArea.Value.Trim()) && hidArea.Value.Trim() != "选择区")
            {
                CompAddr += "-" + hidArea.Value.Trim();
            }
            comp.CompAddr = CompAddr;

            comp.IndID        = txtIndusName.SelectedValue.ToInt(0);
            comp.CreateDate   = DateTime.Now;
            comp.CreateUserID = UserID;
            comp.ts           = DateTime.Now;
            comp.modifyuser   = UserID;
            comp.IsEnabled    = rdEbleYes.Checked ? 1 : 0;
            comp.HotShow      = rdHotShowYes.Checked ? 1 : 0;
            comp.FirstShow    = Convert.ToInt32(ddlChkShow.SelectedValue);// rdFirstShowYes.Checked ? 1 : 0;
            comp.SortIndex    = "001";
            comp.Remark       = Common.NoHTML(txtRemark.Value.Trim());
            comp.Erptype      = ddlErptype.SelectedValue.ToInt(0);
            comp.AuditState   = 0;
            int            comid = 0;
            SqlTransaction Tran  = DBUtility.SqlHelper.CreateStoreTranSaction();
            comid         = new Hi.BLL.BD_Company().Add(comp, Tran);
            comp.CompCode = Common.CreateCode(comid);
            comp.ID       = comid;
            new Hi.BLL.BD_Company().Update(comp, Tran);
            Hi.Model.SYS_Users user = new Hi.Model.SYS_Users();
            user.UserName     = Common.NoHTML(txtUsername.Value.Trim());
            user.TrueName     = Common.NoHTML(txtUserTrueName.Value.Trim());
            user.UserPwd      = Util.md5(txtUpwd.Text.Trim());
            user.Phone        = Common.NoHTML(txtUserPhone.Value.Trim());
            user.AuditState   = 2;
            user.IsEnabled    = 1;
            user.AuditUser    = UserID.ToString();
            user.CreateUserID = UserID;
            user.CreateDate   = DateTime.Now;
            user.ts           = DateTime.Now;
            user.modifyuser   = UserID;
            int userid = 0;
            userid = new Hi.BLL.SYS_Users().Add(user, Tran);
            Hi.Model.SYS_CompUser CompUser = new Hi.Model.SYS_CompUser();
            CompUser.CompID       = comid;
            CompUser.DisID        = 0;
            CompUser.CreateDate   = DateTime.Now;
            CompUser.CreateUserID = UserID;
            CompUser.modifyuser   = UserID;
            CompUser.CType        = 1;
            CompUser.UType        = 4;
            CompUser.IsEnabled    = 1;
            CompUser.IsAudit      = 0;
            CompUser.ts           = DateTime.Now;
            CompUser.dr           = 0;
            CompUser.UserID       = userid;
            new Hi.BLL.SYS_CompUser().Add(CompUser, Tran);
            Tran.Commit();
            Response.Redirect("CompInfo.aspx?go=1&KeyID=" + comid, false);
        }
    }
Exemplo n.º 15
0
    protected void databind()
    {
        if (Session["UserModel"] is LoginModel)
        {
            #region 权限
            LoginModel model = Session["UserModel"] as LoginModel;

            bool isbte = false;
            ////返利
            List <Hi.Model.SYS_SysName> Sysl = new Hi.BLL.SYS_SysName().GetList("", " CompID=" + model.CompID, "");
            Sysl = Sysl.FindAll(p => p.Name == "订单支付返利是否启用");
            if (Sysl != null && Sysl.Count > 0)
            {
                isbte = Sysl[0].Value.ToString() == "1";
            }
            else
            {
                isbte = false;
            }
            ////是否启用库存
            this.spwhgl.Visible = OrderInfoType.rdoOrderAudit("商品是否启用库存", model.CompID) == "0" ? true : false;

            Erptype = model.Erptype;
            if (model != null)
            {
                //获得用户类型
                Hi.Model.SYS_Users sysUser = new Hi.BLL.SYS_Users().GetModel(model.UserID);
                if (sysUser != null && Common.HasAdminRole(sysUser.ID))
                {
                    //订单
                    //ddgl.Visible = true;
                    ddlb.Visible = true;
                    //ddsh.Visible = true;
                    //ddfh.Visible = true;
                    //ddth.Visible = true;

                    //收款
                    // ddskbl.Visible = true;
                    ddskmx.Visible = true;

                    //zdskbl.Visible = true;
                    //zdskmx.Visible = true;

                    //qbcx.Visible = true;

                    //ddsk.Visible = true;
                    //zdsk.Visible = true;
                    //qyqb.Visible = true;

                    //商品
                    splb.Visible   = true;
                    spfl.Visible   = true;
                    spsxwh.Visible = true;
                    spggmb.Visible = true;

                    spkc.Visible = true;
                    sprk.Visible = true;
                    spck.Visible = true;
                    sppd.Visible = false;
                    Dd3.Visible  = true;

                    //jxsjg.Visible = true;
                    //spbks.Visible = true;
                    spcx.Visible = true;
                    ddcx.Visible = true;

                    //代理商
                    jxslb.Visible  = true;
                    jxssh.Visible  = true;
                    jxsgly.Visible = true;

                    jxsfl.Visible = true;
                    jxsqy.Visible = true;
                    //dlssyzl.Visible = true;

                    //我的报表
                    ddtj.Visible   = true;
                    jxstj.Visible  = true;
                    sptj.Visible   = true;
                    zltj.Visible   = true;
                    spxsmx.Visible = true;

                    //sjfx.Visible = true;
                    //zhfx.Visible = true;
                    //ddfx.Visible = true;
                    //jxsfx.Visible = true;
                    //cpfx.Visible = true;
                    //cpabcfx.Visible = true;
                    //ysfx.Visible = true;

                    //设置
                    skzhgl.Visible = true;
                    gwqxwh.Visible = true;
                    ygzhwh.Visible = true;
                    xgdlmm.Visible = true;
                    xtsz.Visible   = true;

                    xxfb.Visible  = true;
                    lyhf.Visible  = true;
                    qyxx.Visible  = true;
                    xsywh.Visible = true;
                    dply.Visible  = true;
                    dpxx.Visible  = true;
                    dpwh.Visible  = true;


                    //商品
                    spxx.Visible   = true;
                    spwh.Visible   = true;
                    spcxgl.Visible = true;
                    //代理商
                    jxsxx.Visible = true;
                    jsxsz.Visible = true;
                    //设置
                    jbsz.Visible = true;
                    xxwh.Visible = true;
                    wddp.Visible = true;

                    //招商
                    zslb.Visible  = true;
                    sylb.Visible  = true;
                    dlssy.Visible = true;
                    wdsy.Visible  = true;

                    //合同
                    htlb.Visible = true;


                    //我的桌面
                    //wdzm.Visible = true;

                    ddglHref.Attributes["href"] = ResolveUrl("../Order/OrderCreateList.aspx");
                    //ddskHref.Attributes["href"] = ResolveUrl("../Report/CompCollection.aspx");
                    goodsHref.Attributes["href"]  = ResolveUrl("../GoodsNew/GoodsList.aspx");
                    disHref.Attributes["href"]    = ResolveUrl("../SysManager/DisList.aspx");
                    reportHref.Attributes["href"] = ResolveUrl("../Report/CustSaleRpt.aspx");
                    sysHref.Attributes["href"]    = ResolveUrl("../Pay/PayAccountList.aspx");

                    zsHref.Attributes["href"] = ResolveUrl("../CMerchants/CMerchantsList.aspx");
                    htHref.Attributes["href"] = ResolveUrl("../Contract/ContractList.aspx");
                }
                else
                {
                    //string sql = "select rf.FunCode from SYS_RoleSysFun rf join SYS_CompUser u on u.RoleID=rf.RoleID where u.UserID=" + model.UserID;
                    //DataTable dt = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0];
                    List <Hi.Model.SYS_RoleSysFun> list = new Hi.BLL.SYS_RoleSysFun().GetList(" FunCode ", " CompID=" + model.CompID + " AND  RoleID IN (SELECT RoleID FROM dbo.SYS_RoleUser WHERE UserID=" + model.UserID + " AND IsEnabled=1 AND dr=0) GROUP BY FunCode ", "");
                    for (int i = 0; i < list.Count; i++)
                    {
                        string code = list[i].FunCode.ToString();
                        switch (code)
                        {
                        //订单
                        case "10":
                            ddglHref.Attributes["href"] = ResolveUrl("../Order/OrderCreateList.aspx");
                            break;

                        case "1011":
                            ddlb.Visible = true;
                            break;

                        case "1111":
                            ddskmx.Visible = true;
                            break;
                        //case "1112":
                        //    zdskbl.Visible = true;
                        //    break;
                        //case "1114":
                        //    zdskmx.Visible = true;
                        //    break;
                        //case "1115":
                        //    qbcx.Visible = true;
                        //    break;


                        //商品
                        case "12":
                            goodsHref.Attributes["href"] = ResolveUrl("../GoodsNew/GoodsInfoList.aspx");
                            break;

                        case "1210":
                            splb.Visible = true;
                            break;

                        case "1213":
                            spkc.Visible = true;
                            break;

                        case "1214":
                            spfl.Visible = true;
                            break;

                        //case "1215":
                        //    jxsjg.Visible = true;
                        //    break;
                        case "1216":
                            spsxwh.Visible = true;
                            break;

                        case "1217":
                            spggmb.Visible = true;
                            break;

                        //case "1218":
                        //    spbks.Visible = true;
                        //    break;
                        case "1219":
                            spcx.Visible = true;
                            break;

                        case "1220":
                            spkc.Visible = true;
                            break;

                        case "1221":
                            sprk.Visible = true;
                            break;

                        case "1223":
                            spck.Visible = true;
                            break;

                        case "1225":
                            sppd.Visible = false;
                            break;

                        case "1227":
                            Dd3.Visible = true;
                            break;

                        case "1232":
                            spcx.Visible = true;
                            break;

                        case "1233":
                            ddcx.Visible = true;
                            break;

                        //代理商
                        case "13":
                            disHref.Attributes["href"] = ResolveUrl("../SysManager/DisList.aspx");
                            break;

                        case "1310":
                            jxslb.Visible = true;
                            break;

                        case "1312":
                            jxssh.Visible = true;
                            break;

                        case "1314":
                            jxsgly.Visible = true;
                            break;

                        case "1315":
                            jxsfl.Visible = true;
                            break;

                        case "1316":
                            jxsqy.Visible = true;
                            break;


                        //我的报表
                        case "14":
                            reportHref.Attributes["href"] = ResolveUrl("../Report/CustSaleRpt.aspx");
                            break;

                        case "1410":
                            ddtj.Visible = true;
                            break;

                        case "1411":
                            jxstj.Visible = true;
                            break;

                        case "1412":
                            sptj.Visible = true;
                            break;

                        case "1413":
                            zltj.Visible = true;
                            break;

                        case "1414":
                            spxsmx.Visible = true;
                            break;
                        //case "1416":
                        //    zhfx.Visible = true;
                        //    break;
                        //case "1417":
                        //    ddfx.Visible = true;
                        //    break;
                        //case "1418":
                        //    jxsfx.Visible = true;
                        //    break;
                        //case "1419":
                        //    cpfx.Visible = true;
                        //    break;
                        //case "1420":
                        //    cpabcfx.Visible = true;
                        //    break;
                        //case "1421":
                        //    ysfx.Visible = true;
                        //    break;

                        //设置
                        case "15":
                            sysHref.Attributes["href"] = ResolveUrl("../Pay/PayAccountList.aspx");
                            break;

                        case "1510":
                            skzhgl.Visible = true;
                            break;

                        case "1511":
                            gwqxwh.Visible = true;
                            break;

                        case "1512":
                            ygzhwh.Visible = true;
                            break;

                        case "1513":
                            xtsz.Visible = true;
                            break;

                        case "1514":
                            xxfb.Visible = true;
                            break;

                        case "1515":
                            lyhf.Visible = true;
                            break;

                        case "1516":
                            qyxx.Visible = true;
                            break;

                        case "1517":
                            xsywh.Visible = true;
                            break;

                        case "1518":
                            dpxx.Visible = true;
                            break;

                        case "1519":
                            dpwh.Visible = true;
                            break;

                        case "1520":
                            dply.Visible = true;
                            break;

                        //招商
                        case "16":
                            zsHref.Attributes["href"] = ResolveUrl("../CMerchants/CMerchantsList.aspx");
                            break;

                        case "1611":
                            zslb.Visible = true;
                            break;

                        case "1614":
                            sylb.Visible = true;
                            break;

                        case "1617":
                            dlssy.Visible = true;
                            break;

                        case "1618":
                            wdsy.Visible = true;
                            break;

                        //合同
                        case "17":
                            htHref.Attributes["href"] = ResolveUrl("../Contract/ContractList.aspx");
                            break;

                        case "1711":
                            htlb.Visible = true;
                            break;
                        }
                        string[] OrderCode = new string[] { "1011", "1012", "1013", "1015" };
                        if (OrderCode.Contains(code))
                        {
                            ddglHref.Attributes["href"] = ResolveUrl("../Order/OrderCreateList.aspx");
                        }
                    }

                    //我的桌面
                    //wdzm.Style.Add("display", "none;");
                    //我要开通
                    //ktwykt.Style.Add("display", "none;");
                }
                //我要维护,修改登录密码
                xgdlmm.Visible = true;
                //gmfw.Visible = true;
            }
            #endregion
        }
    }
Exemplo n.º 16
0
    /// <summary>
    /// 商品信息绑定
    /// </summary>
    public void Bind()
    {
        LoginModel logmodel = HttpContext.Current.Session["UserModel"] as LoginModel;

        Hi.Model.BD_Goods model = new Hi.BLL.BD_Goods().GetModel(goodsId);
        if (model != null)
        {
            GetZiDingYi(model);
            mKeyword.Content = string.IsNullOrWhiteSpace(model.Title) ? model.GoodsName : model.Title;
            string zhek = Cuxiao();
            if (!Util.IsEmpty(zhek))
            {
                this.lblGoodsName.InnerHtml = model.GoodsName + SelectGoods.ProType(zhek); //商品名称
                tiele_name = model.GoodsName;                                              //前台title显示
                if (hidGoodsInfoId.Value != null && hidGoodsInfoId.Value != "")
                {
                    Hi.Model.BD_GoodsInfo godosInfomodel = new Hi.BLL.BD_GoodsInfo().GetModel(Convert.ToInt32(hidGoodsInfoId.Value));
                    //add by hgh 未登录,原价不可见
                    //if (logmodel != null)
                    //{


                    if (Request["Comid"].ToString() == model.CompID.ToString())
                    {
                        this.YuanPrice.InnerHtml = "<s><i>原价:</i><b class=\"red\" id=\"B1\">" + decimal.Parse(string.Format("{0:N2}", Convert.ToDecimal(godosInfomodel.TinkerPrice).ToString())).ToString("#,##0.00") + "</b></s>";
                    }
                    else
                    {
                        string sysNameWhere = string.Format(" CompID={0} and Name='是否店铺开放价格'", Request["Comid"].ToInt(0));
                        List <Hi.Model.SYS_SysName> Sysl = new Hi.BLL.SYS_SysName().GetList("", sysNameWhere, "");
                        if (Sysl.Count > 0)
                        {
                            if (Sysl[0].Value == "1")
                            {
                                this.YuanPrice.InnerHtml = "<s><i>原价:</i><b class=\"red\" id=\"B1\">" + decimal.Parse(string.Format("{0:N2}", Convert.ToDecimal(godosInfomodel.TinkerPrice).ToString())).ToString("#,##0.00") + "</b></s>";
                            }
                        }
                    }
                    //}
                }
            }
            else
            {
                this.lblGoodsName.InnerHtml = model.GoodsName;
                tiele_name = model.GoodsName;//前台title显示
                this.YuanPrice.InnerHtml = "";
            }
            this.lblunit.InnerText       = model.Unit;
            this.lblGoodsTitle.InnerText = model.Title;//商品卖点
            hideInfo1 = model.HideInfo1;
            hideInfo2 = model.HideInfo2;
            if (!Util.IsEmpty(model.Details.Trim()))
            {
                this.lblGoodsDetali.InnerHtml = model.Details.Replace("<pre>", "<p>").Replace("</pre>", "</p>");//商品描述
            }
            if (!Util.IsEmpty(model.registeredCertificate.Trim()))
            {
                string url = Common.GetWebConfigKey("OssImgPath") + "UploadFile/" + model.registeredCertificate;
                this.lblGoodsDetali1.InnerHtml = "<img width=\"600\" src=\"" + url + "\"/>";
            }
            //this.lblPrice.InnerText = "¥" + decimal.Parse(string.Format("{0:N2}", Convert.ToDecimal(model.SalePrice.ToString()).ToString())).ToString("#,##0.00"); ;//商品价格
            if (model != null && !string.IsNullOrEmpty(model.Pic))
            {
                this.imgPic.Src = Common.GetPicURL(model.Pic, "resize400", compId.ToString());
                this.imgPic.Attributes.Add("jqimg", Common.GetPicURL(model.Pic, "", compId.ToString()));
            }
            else
            {
                imgPic.Src = "../images/Goods400x400.jpg";//无图片
                imgPic.Attributes.Add("jqimg", "../images/Goods400x400.jpg");
            }
            string html = string.Empty;
            List <Hi.Model.BD_GoodsAttrs> ll = new Hi.BLL.BD_GoodsAttrs().GetList("", "isnull(dr,0)=0 and compId=" + compId + " and goodsId=" + goodsId.ToString(), "");
            if (ll.Count > 0)
            {
                foreach (Hi.Model.BD_GoodsAttrs item in ll)
                {
                    int xy = 0;
                    List <Hi.Model.BD_GoodsAttrsInfo> lll = new Hi.BLL.BD_GoodsAttrsInfo().GetList("", "isnull(dr,0)=0 and compId=" + compId + " and attrsId=" + item.ID, "");
                    if (lll.Count > 0)
                    {
                        //add by hgh
                        if (item.AttrsName.Length > 4)
                        {
                            item.AttrsName = item.AttrsName.Substring(0, 4);
                        }
                        html += "<div class=\"li\"><div class=\"t\" tip=\"" + item.AttrsName + "\">" + item.AttrsName + ":</div><div class=\"n\">";
                        foreach (Hi.Model.BD_GoodsAttrsInfo item2 in lll)
                        {
                            if (goodsInfoId == 0)
                            {
                                html += "<a href=\"javascript:;\" class=\"" + (xy == 0 ? "hover" : "") + "\" tip=\"" + item2.AttrsInfoName + "\">" + item2.AttrsInfoName + "<i class=\"xz-icon\"></i></a>";
                            }
                            else
                            {
                                Hi.Model.BD_GoodsInfo model2 = new Hi.BLL.BD_GoodsInfo().GetModel(goodsInfoId);
                                if (model2 != null)
                                {
                                    html += "<a href=\"javascript:;\" class=\"" + (model2.Value1 == item2.AttrsInfoName || model2.Value2 == item2.AttrsInfoName || model2.Value3 == item2.AttrsInfoName ? "hover" : "") + "\" tip=\"" + item2.AttrsInfoName + "\">" + item2.AttrsInfoName + "<i class=\"xz-icon\"></i></a>";
                                }
                            }
                            xy++;
                        }
                        html += "</div></div>";
                    }
                }
            }
            litAttrVaue.InnerHtml = html;
            if (logmodel != null)
            {
                List <Hi.Model.BD_DisCollect> llll = new Hi.BLL.BD_DisCollect().GetList("", "isnull(dr,0)=0 and comPid=" + model.CompID + " and goodsId=" + goodsId + " and disId=" + logmodel.DisID, "");
                if (llll.Count > 0)
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "showsc", "<script>$(function(){$(\".btn .keep\").html('<i class=\"sc-icon\" style=\"background-position:0 -73px;\"></i>取消收藏\');})</script>");
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "showsc", "<script>$(function(){$(\".btn .keep\").html('<i class=\"sc-icon\" ></i>加入收藏\');})</script>");
                }
            }
        }
    }
Exemplo n.º 17
0
    /// <summary>
    /// 获取价格
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public string GetProPrice(string values, string comPid, string goodsId)
    {
        string sysNameWhere = string.Format(" CompID={0} and Name='是否店铺开放价格'", Request["Comid"].ToInt(0));
        List <Hi.Model.SYS_SysName> Sysl = new Hi.BLL.SYS_SysName().GetList("", sysNameWhere, "");

        string     str   = "暂无价格";
        LoginModel model = HttpContext.Current.Session["UserModel"] as LoginModel;

        Hi.Model.BD_Goods goodsModel = new Hi.BLL.BD_Goods().GetModel(Convert.ToInt32(goodsId));
        if (goodsModel == null)
        {
            return("商品已删除");
        }
        if (model == null || model.CompID != comPid.ToInt(0))
        {
            if (Sysl.Count > 0)
            {
                if (Sysl[0].Value != "1")
                {
                    if (goodsModel.IsLS != 0)
                    {
                        return(goodsModel.LSPrice.ToString("#0.00"));
                    }
                    return("代理商可见");
                }
            }
            else
            {
                if (goodsModel.IsLS != 0)
                {
                    return(goodsModel.LSPrice.ToString("#0.00"));
                }
                return("代理商可见");
            }
        }
        string    values2 = Common.NoHTML(values);
        DataTable dt      = Session["price"] as DataTable;

        if (dt.Rows.Count != 0)
        {
            if (dt.Select("isnull(valueinfo,'')='" + values2 + "'").Length != 0)
            {
                if (dt.Select("isnull(valueinfo,'')='" + values2 + "'")[0]["isoffline"].ToString() == "0")
                {
                    return("商品已下架");
                }

                string id = dt.Select("isnull(valueinfo,'')='" + values2 + "'")[0]["Id"].ToString();
                str = BLL.Common.GetGoodsPrice(comPid.ToInt(0), comPid.ToInt(0), id.ToInt(0)).ToString("0.00") + "," + id;
            }
            else
            {
                str = "商品已删除";
            }
        }
        else
        {
            str = goodsModel.SalePrice.ToString("0.00");
        }

        //else
        //{
        //    if (goodsModel.IsLS == 0)
        //    {
        //        string sysNameWhere = string.Format(" CompID={0} and Name='是否店铺开放价格'", Request["Comid"].ToInt(0));
        //        List<Hi.Model.SYS_SysName> Sysl = new Hi.BLL.SYS_SysName().GetList("", sysNameWhere, "");
        //        if (Sysl.Count > 0)
        //        {
        //            if (Sysl[0].Value == "1")
        //            {
        //                return goodsModel.SalePrice.ToString("#0.00");
        //            }

        //        }
        //        return "代理商可见";
        //    }
        //    return goodsModel.LSPrice.ToString("#0.00");
        //}
        return(str);
    }
Exemplo n.º 18
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>");
        }
    }