示例#1
0
        /// <summary>
        /// 删除行业信息
        /// </summary>
        void TradeDelete()
        {
            MLMGC.Security.PersonalPage pp = new MLMGC.Security.PersonalPage(true);
            int     tradeid = int.Parse(nv["tradeid"]);
            E_Trade data    = new E_Trade();

            data.PersonalID = pp.PersonalID;
            data.TradeID    = tradeid;
            bool b = new T_Trade().Delete(data);

            HttpContext.Current.Response.Write(b ? "1" : "0");
        }
示例#2
0
        /// <summary>
        /// 行业是否存在
        /// </summary>
        void TradeExists()
        {
            MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true);
            int     tradeid = int.Parse(nv["tradeid"]);
            string  code    = nv["code"];
            E_Trade data    = new E_Trade();

            data.EnterpriseID = ep.EnterpriceID;
            data.TradeID      = tradeid;
            data.TradeCode    = code;
            bool b = new T_Trade().Exists(data);

            HttpContext.Current.Response.Write(b ? "1" : "0");
        }
示例#3
0
        /// <summary>
        /// 录入新行业
        /// </summary>
        void TradeAdd()
        {
            MLMGC.Security.PersonalPage pp = new MLMGC.Security.PersonalPage(true);
            string  name = nv["name"];
            E_Trade data = new E_Trade();

            data.PersonalID = pp.PersonalID;
            data.TradeID    = 0;
            data.TradeCode  = "";
            data.TradeName  = name;
            int tradeid = new T_Trade().Add(data);

            HttpContext.Current.Response.Write(tradeid);
        }
示例#4
0
        /// <summary>
        /// 行业是否存在
        /// </summary>
        void TradeExists()
        {
            MLMGC.Security.PersonalPage pp = new MLMGC.Security.PersonalPage(true);
            int     tradeid = int.Parse(nv["tradeid"]);
            string  name    = nv["name"];
            E_Trade data    = new E_Trade();

            data.PersonalID = pp.PersonalID;
            data.TradeID    = tradeid;
            data.TradeName  = name;
            bool b = new T_Trade().Exists(data);

            HttpContext.Current.Response.Write(b ? "1" : "0");
        }
示例#5
0
        /// <summary>
        /// 删除行业信息
        /// </summary>
        void TradeDelete()
        {
            MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true);
            int     tradeid = int.Parse(nv["tradeid"]);
            E_Trade data    = new E_Trade();

            data.EnterpriseID = ep.EnterpriceID;
            data.TradeID      = tradeid;
            bool b = new T_Trade().Delete(data);

            new MLMGC.BLL.Enterprise.T_Log().Add(new MLMGC.DataEntity.Enterprise.E_Log()
            {
                EnterpriseID = ep.EnterpriceID, UserID = ep.UserID, LogTitle = "删除行业", IP = MLMGC.COMP.Requests.GetRealIP()
            });
            HttpContext.Current.Response.Write(b ? "1" : "0");
        }
示例#6
0
        /// <summary>
        /// 录入新行业
        /// </summary>
        void TradeAdd()
        {
            MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true);
            string  code = nv["code"];
            string  name = nv["name"];
            E_Trade data = new E_Trade();

            data.EnterpriseID = ep.EnterpriceID;
            data.TradeID      = 0;
            data.TradeCode    = code;
            data.TradeName    = name;
            int tradeid = new T_Trade().Add(data);

            new MLMGC.BLL.Enterprise.T_Log().Add(new MLMGC.DataEntity.Enterprise.E_Log()
            {
                EnterpriseID = ep.EnterpriceID, UserID = ep.UserID, LogTitle = "添加行业", IP = MLMGC.COMP.Requests.GetRealIP()
            });
            HttpContext.Current.Response.Write(tradeid);
        }
示例#7
0
        /// <summary>
        /// 修改行业
        /// </summary>
        void TradeUpdate()
        {
            MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true);
            int     tradeid = int.Parse(nv["tradeid"]);
            string  code    = nv["code"];
            string  name    = nv["name"];
            E_Trade data    = new E_Trade();

            data.EnterpriseID = ep.EnterpriceID;
            data.TradeID      = tradeid;
            data.TradeCode    = code;
            data.TradeName    = name;
            bool b = new T_Trade().Update(data);

            new MLMGC.BLL.Enterprise.T_Log().Add(new MLMGC.DataEntity.Enterprise.E_Log()
            {
                EnterpriseID = ep.EnterpriceID, UserID = ep.UserID, LogTitle = "修改行业", IP = MLMGC.COMP.Requests.GetRealIP()
            });
            HttpContext.Current.Response.Write(b ? "1" : "0");
        }
示例#8
0
        /// <summary>
        /// 显示行业信息
        /// </summary>
        void TradeShow()
        {
            MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true);
            int     tradeid = int.Parse(nv["tradeid"]);
            E_Trade data    = new E_Trade();

            data.EnterpriseID = ep.EnterpriceID;
            data.TradeID      = tradeid;
            data = new T_Trade().GetModel(data);
            if (data == null)
            {
                data         = new E_Trade();
                data.TradeID = 0;
            }
            JsonObjectCollection colDR = new JsonObjectCollection();

            colDR.Add(new JsonStringValue("id", data.TradeID.ToString()));
            colDR.Add(new JsonStringValue("code", data.TradeCode));
            colDR.Add(new JsonStringValue("name", data.TradeName));
            HttpContext.Current.Response.Write(colDR.ToString());
        }
示例#9
0
        /// <summary>
        /// 检查数据是否合法
        /// </summary>
        /// <param name="shtClient">名录信息</param>
        /// <param name="shtSource">来源信息</param>
        /// <param name="shtTrade">行业信息</param>
        /// <param name="shtArea">地区信息</param>
        /// <returns></returns>
        protected bool Check(HSSFSheet shtClient)
        {
            string       name, sourcecode, tradecode, areacode;
            T_Area       bllArea   = new T_Area();
            T_Source     bllSource = new T_Source();
            T_Trade      bllTrade  = new T_Trade();
            T_ClientInfo bll       = new T_ClientInfo();
            bool         b         = true;
            int          count     = 0;
            DataTable    dt        = null;

            //------检查名录信息是否合法
            if (b && CheckSheet(shtClient, strClientName, 16))//判断名录信息表是否合法
            {
                //-----检查名称是否已经存在
                count = shtClient.LastRowNum;
                for (int i = 1; i <= count; ++i)//从第2行开始
                {
                    if (ISCheckRowStrNullOrEmpty(i, shtClient))
                    {
                        continue;
                    }
                    name       = GetCellValue(shtClient.GetRow(i).GetCell(0));  //名称
                    sourcecode = GetCellValue(shtClient.GetRow(i).GetCell(12)); //来源
                    tradecode  = GetCellValue(shtClient.GetRow(i).GetCell(13)); //行业
                    areacode   = GetCellValue(shtClient.GetRow(i).GetCell(14)); //地区
                    if (string.IsNullOrWhiteSpace(name))
                    {
                        _result.Add(string.Format("名录名录为空! 位置[{0}]中,第{1}行", strClientName, i));
                        b = false;
                        continue;
                    }
                    dt = bll.Exists(new E_ClientInfo()
                    {
                        EnterpriseID = _enterpriseid, ClientName = name, ClientInfoID = 0
                    });
                    if (dt == null || dt.Rows.Count == 0)
                    {
                        _result.Add("出错了!");
                        b = false;
                        continue;
                    }
                    if (dt.Rows[0]["Flag"].ToString() != "-1")
                    {
                        _result.Add(string.Format("[{0}]已经在数据库中存在! 位置[{1}]中,第{2}行", name, strClientName, i));
                        b = false;
                    }
                    //--------判断属性是否完成--------
                    //判断来源
                    if (!string.IsNullOrEmpty(sourcecode) && !bllSource.Exists(new E_Source()
                    {
                        EnterpriseID = _enterpriseid, SourceCode = sourcecode, SourceID = 0
                    }))
                    {
                        _result.Add("无来源编码:" + sourcecode);
                        b = false;
                    }
                    //判断行业
                    if (!string.IsNullOrEmpty(tradecode) && !bllTrade.Exists(new E_Trade()
                    {
                        EnterpriseID = _enterpriseid, TradeCode = tradecode, TradeID = 0
                    }))
                    {
                        _result.Add("无行业编码:" + tradecode);
                        b = false;
                    }
                    //判断地区
                    if (!string.IsNullOrEmpty(areacode) && !bllArea.Exists(new E_Area()
                    {
                        EnterpriseID = _enterpriseid, AreaCode = areacode, AreaID = 0
                    }))
                    {
                        _result.Add("无地区编码:" + areacode);
                        b = false;
                    }
                }
            }
            else
            {
                return(false);
            }
            return(b);
        }