Exemple #1
0
        /// <summary>
        /// 删除地区
        /// </summary>
        void AreaDelete()
        {
            MLMGC.Security.PersonalPage pp = new MLMGC.Security.PersonalPage(true);
            int    areaid = int.Parse(nv["areaid"]);
            E_Area data   = new E_Area();

            data.PersonalID = pp.PersonalID;
            data.AreaID     = areaid;
            bool b = new T_Area().Delete(data);

            HttpContext.Current.Response.Write(b ? "1" : "0");
        }
Exemple #2
0
        /// <summary>
        /// 地区是否存在
        /// </summary>
        void AreaExists()
        {
            MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true);
            int    areaid = int.Parse(nv["areaid"]);
            string code   = nv["code"];
            E_Area data   = new E_Area();

            data.EnterpriseID = ep.EnterpriceID;
            data.AreaID       = areaid;
            data.AreaCode     = code;
            bool b = new T_Area().Exists(data);

            HttpContext.Current.Response.Write(b ? "1" : "0");
        }
Exemple #3
0
        /// <summary>
        /// 地区是否存在
        /// </summary>
        void AreaExists()
        {
            MLMGC.Security.PersonalPage pp = new MLMGC.Security.PersonalPage(true);
            int    areaid = int.Parse(nv["areaid"]);
            string name   = nv["name"];
            E_Area data   = new E_Area();

            data.PersonalID = pp.PersonalID;
            data.AreaID     = areaid;
            data.AreaName   = name;
            bool b = new T_Area().Exists(data);

            HttpContext.Current.Response.Write(b ? "1" : "0");
        }
Exemple #4
0
        /// <summary>
        /// 录入新地区
        /// </summary>
        void AreaAdd()
        {
            MLMGC.Security.PersonalPage pp = new MLMGC.Security.PersonalPage(true);
            //string code = nv["code"];
            string name = nv["name"];
            E_Area data = new E_Area();

            data.PersonalID = pp.PersonalID;
            data.AreaID     = 0;
            data.AreaCode   = "";
            data.AreaName   = name;
            int areaid = new T_Area().Add(data);

            HttpContext.Current.Response.Write(areaid);
        }
Exemple #5
0
        /// <summary>
        /// 删除地区
        /// </summary>
        void AreaDelete()
        {
            MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true);
            int    areaid = int.Parse(nv["areaid"]);
            E_Area data   = new E_Area();

            data.EnterpriseID = ep.EnterpriceID;
            data.AreaID       = areaid;
            bool b = new T_Area().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");
        }
Exemple #6
0
        /// <summary>
        /// 录入新地区
        /// </summary>
        void AreaAdd()
        {
            MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true);
            string code = nv["code"];
            string name = nv["name"];
            E_Area data = new E_Area();

            data.EnterpriseID = ep.EnterpriceID;
            data.AreaID       = 0;
            data.AreaCode     = code;
            data.AreaName     = name;
            int areaid = new T_Area().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(areaid);
        }
Exemple #7
0
        /// <summary>
        /// 修改地区
        /// </summary>
        void AreaUpdate()
        {
            MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true);
            int    areaid = int.Parse(nv["areaid"]);
            string code   = nv["code"];
            string name   = nv["name"];
            E_Area data   = new E_Area();

            data.EnterpriseID = ep.EnterpriceID;
            data.AreaID       = areaid;
            data.AreaCode     = code;
            data.AreaName     = name;
            bool b = new T_Area().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");
        }
Exemple #8
0
        /// <summary>
        /// 显示地区信息
        /// </summary>
        void AreaShow()
        {
            MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true);
            int    areaid = int.Parse(nv["areaid"]);
            E_Area data   = new E_Area();

            data.EnterpriseID = ep.EnterpriceID;
            data.AreaID       = areaid;
            data = new T_Area().GetModel(data);
            if (data == null)
            {
                data        = new E_Area();
                data.AreaID = 0;
            }
            JsonObjectCollection colDR = new JsonObjectCollection();

            colDR.Add(new JsonStringValue("id", data.AreaID.ToString()));
            colDR.Add(new JsonStringValue("code", data.AreaCode));
            colDR.Add(new JsonStringValue("name", data.AreaName));
            HttpContext.Current.Response.Write(colDR.ToString());
        }
Exemple #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);
        }