Ejemplo n.º 1
0
        /// <summary>
        /// 彻底删除按钮处理事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            string ciids = hdClientInfoIDs.Value;

            hdClientInfoIDs.Value = "";
            if (!MLMGC.COMP.StringUtil.IsStringArrayList(ciids))//判断格式是否正确 格式:1,21,321
            {
                HttpContext.Current.Response.Write("参数错误");
                return;
            }
            E_ItemClientInfo data = new E_ItemClientInfo();

            data.EnterpriseID  = EnterpriceID;
            data.ClientInfoIDs = ciids;

            bool flag = new T_ItemClientInfo().ThoroughDelete(data);

            if (flag)
            {
                Jscript.AlertAndRedirect(this, "删除成功", "Recycled.aspx");
            }
            else
            {
                Jscript.ShowMsg("删除失败", this);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 修改名录的状态
        /// </summary>
        private void UpdateStatus()
        {
            E_ItemClientInfo data = new E_ItemClientInfo();

            data.EnterpriseID = pp.EnterpriseID;
            data.UserID       = pp.UserID;
            data.ClientInfoID = Convert.ToInt32(nv["ciid"]);
            data.SetStatus    = Convert.ToInt32(nv["status"]);
            if (data.Status == EnumClientStatus.所有状态)//判断是否是可用状态
            {
                HttpContext.Current.Response.Write("参数错误啦");
                return;
            }
            if (data.Status == EnumClientStatus.意向客户)
            {
                data.WishID = Convert.ToInt32(nv["wishid"]);
            }
            else if (data.Status == EnumClientStatus.成交客户)
            {
                data.TradedMoney = float.Parse(nv["money"]);
            }
            else if (data.Status == EnumClientStatus.失败客户)
            {
                data.NotTradedID = Convert.ToInt32(nv["nottradedid"]);
            }
            else if (data.Status == EnumClientStatus.报废客户)
            {
                data.ScrapID = Convert.ToInt32(nv["scrapid"]);
            }
            bool b = new T_ItemClientInfo().UpdateStatus(data);

            HttpContext.Current.Response.Write(b ? "1" : "0");
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 企业总监删除所有共享名录
        /// </summary>
        private void DeleteAll()
        {
            E_ItemClientInfo data = new E_ItemClientInfo();

            data.EnterpriseID = bp.EnterpriceID;
            data.Status       = MLMGC.DataEntity.Item.EnumClientStatus.共享;
            bool b = new T_ItemClientInfo().DeleteAll(data);

            HttpContext.Current.Response.Write(b ? "1" : "0");
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 修改基本信息
        /// </summary>
        private void UpdateBase()
        {
            E_ItemClientInfo data = new E_ItemClientInfo();

            data.EnterpriseID = pp.EnterpriseID;
            data.UserID       = pp.UserID;
            data.ClientInfoID = Convert.ToInt32(nv["ciid"]);
            data.ClientName   = nv["clientname"];
            data.Address      = nv["address"];
            data.AreaID       = Convert.ToInt32(nv["areaid"]);
            data.Website      = nv["website"];
            data.Email        = nv["email"];
            data.Fax          = nv["fax"];
            data.Linkman      = nv["linkman"];
            data.Mobile       = nv["mobile"];
            data.Position     = nv["position"];
            data.QQ           = nv["qq"];
            data.MSN          = nv["msn"];
            data.Remark       = nv["remark"];
            data.SourceID     = Convert.ToInt32(nv["sourceid"]);
            data.Tel          = nv["tel"];
            data.TradeID      = Convert.ToInt32(nv["tradeid"]);
            data.ZipCode      = nv["zipcode"];
            //修改之前再次确认名录名称、电话、手机是否唯一
            bool flag = false;

            flag = new T_ItemClientInfo().Exists(new E_ItemClientInfo {
                EnterpriseID = data.EnterpriseID, ClientInfoID = data.ClientInfoID, Type = 0, Value = data.ClientName
            });

            //如果手机不为空
            if (!string.IsNullOrEmpty(data.Mobile.Trim()))
            {
                flag = flag || new T_ItemClientInfo().Exists(new E_ItemClientInfo {
                    EnterpriseID = data.EnterpriseID, ClientInfoID = data.ClientInfoID, Type = 1, Value = data.Mobile
                });
            }
            //如果电话不为空
            if (!string.IsNullOrEmpty(data.Tel.Trim()))
            {
                flag = flag || new T_ItemClientInfo().Exists(new E_ItemClientInfo {
                    EnterpriseID = data.EnterpriseID, ClientInfoID = data.ClientInfoID, Type = 2, Value = data.Tel
                });
            }
            if (flag)
            {
                return;
            }
            bool b = new T_ItemClientInfo().Update(data);

            HttpContext.Current.Response.Write(b ? "1" : "0");
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 判断名录名称手机电话是否存在
        /// </summary>
        private void ClientInfoExists()
        {
            string type  = nv["type"];
            string value = nv["value"].Trim();
            bool   b     = false;

            if (type == "0")
            {
                b = true;
            }
            else if (type == "1")
            {
                Regex m = new Regex(@"^1(3|5|8)+\d{9}$");//验证手机号
                b = m.IsMatch(value);
            }
            else if (type == "2")
            {
                Regex t = new Regex(@"^(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$");//验证电话
                b = t.IsMatch(value);
            }
            if (!b || string.IsNullOrWhiteSpace(type))
            {
                HttpContext.Current.Response.Write("参数错误");
                return;
            }
            int ciid = 0;

            int.TryParse(nv["ciid"], out ciid);
            E_ItemClientInfo data = new E_ItemClientInfo();

            data.EnterpriseID = pp.EnterpriseID;
            data.ClientInfoID = ciid;
            data.Type         = Convert.ToInt32(type);
            data.Value        = value;
            bool   flag   = new T_ItemClientInfo().Exists(data);
            string result = string.Empty;

            if (!flag)
            {
                result = "可以使用!";
            }
            else
            {
                result = string.Format("该{0}已存在", type == "0" ? "名录":type == "1"?"手机号码" : "电话号码");
            }
            JsonObjectCollection colDR = new JsonObjectCollection();

            colDR.Add(new JsonStringValue("flag", flag ? "0" : "1"));
            colDR.Add(new JsonStringValue("detail", result));
            HttpContext.Current.Response.Write(colDR.ToString());
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 删除所有名录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnDeleteAll_Click(object sender, EventArgs e)
        {
            E_ItemClientInfo data = new E_ItemClientInfo();

            data.EnterpriseID = EnterpriceID;

            bool flag = new T_ItemClientInfo().ThoroughDeleteAll(data);

            if (flag)
            {
                Jscript.AlertAndRedirect(this, "删除成功", "Recycled.aspx");
            }
            else
            {
                Jscript.ShowMsg("删除失败", this);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 企业总监删除名录
        /// </summary>
        private void Delete()
        {
            string ids = nv["ids"];

            if (MLMGC.COMP.StringUtil.IsStringArrayList(ids))
            {
                E_ItemClientInfo data = new E_ItemClientInfo();
                data.EnterpriseID  = bp.EnterpriceID;
                data.UserID        = 0;
                data.ClientInfoIDs = ids;
                bool b = new T_ItemClientInfo().Delete(data);
                HttpContext.Current.Response.Write(b ? "1" : "0");
            }
            else
            {
                HttpContext.Current.Response.Write("参数错误");
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 从共享池中获取名录
        /// </summary>
        private void MyGet()
        {
            string ids = nv["ids"];

            if (!MLMGC.COMP.StringUtil.IsStringArrayList(ids))//判断格式是否正确 格式:1,21,321
            {
                HttpContext.Current.Response.Write("参数错误");
                return;
            }
            E_ItemClientInfo data = new E_ItemClientInfo();

            data.EnterpriseID  = pp.EnterpriseID;
            data.ClientInfoIDs = ids;
            data.UserID        = pp.UserID;
            data.Status        = EnumClientStatus.潜在客户;//目标状态
            bool b = new T_ItemClientInfo().ShiftShare(data);

            HttpContext.Current.Response.Write(b ? "1" : "0");
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 个人用户共享项目名录
        /// </summary>
        private void Share()
        {
            string ids = nv["ids"];

            if (MLMGC.COMP.StringUtil.IsStringArrayList(ids))
            {
                E_ItemClientInfo data = new E_ItemClientInfo();
                data.EnterpriseID  = pp.EnterpriseID;
                data.UserID        = pp.UserID;
                data.ClientInfoIDs = ids;
                data.Status        = EnumClientStatus.共享;
                bool b = new T_ItemClientInfo().UpdateShare(data);
                HttpContext.Current.Response.Write(b ? "1" : "0");
            }
            else
            {
                HttpContext.Current.Response.Write("参数错误");
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 绑定页面数据
        /// </summary>
        protected void databind()
        {
            int ciid = Requests.GetQueryInt("ciid", 0);
            //-----------------绑定基本信息------------------------------
            E_ItemClientInfo data = new T_ItemClientInfo().GetModel(new E_ItemClientInfo()
            {
                EnterpriseID = EnterpriseID, ClientInfoID = ciid, UserID = 0
            });

            if (data == null)
            {
                Response.Write("<script type='text/javascript'>alert('信息不存在');history.go(-1);</script>");
                return;
            }
            ltClientName.Text     = data.ClientName;
            ltAddress.Text        = data.Address;
            ltZipCode.Text        = data.ZipCode;
            ltLinkman.Text        = data.Linkman;
            ltPosition.Text       = data.Position;
            ltEmail.Text          = data.Email;
            ltTel.Text            = data.Tel;
            ltMobile.Text         = data.Mobile;
            hlWebsite.NavigateUrl = data.Website.IndexOf("http://") == -1 ? "http://" + data.Website : data.Website;
            hlWebsite.Text        = data.Website;
            ltFax.Text            = data.Fax;
            ltRemark.Text         = data.Remark;
            //-----------------绑定名录属性------------------------------
            Property1.SourceID = data.SourceID;
            Property1.TradeID  = data.TradeID;
            Property1.AreaID   = data.AreaID;
            //-----------------绑定状态------------------------------
            ltStatus.Text = data.Status.ToString();
            //----------------绑定沟通记录---------------------
            rpExchangeList.DataSource = new T_ItemExchange().GetList(new E_ItemExchange()
            {
                EnterpriseID = EnterpriseID, ClientInfoID = ciid
            });
            rpExchangeList.DataBind();
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 项目名录--》个人名录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnIPSwitch_Click(object sender, EventArgs e)
        {
            //获取导入数量
            int num;

            if (!int.TryParse(txtTotalCount.Text.Trim(), out num))
            {
                Jscript.ShowMsg("请输入正确的整数", this);
                return;
            }
            if (num < 0 || num > 2000)
            {
                Jscript.ShowMsg("请输入1-2000的整数", this);
                return;
            }

            E_ItemClientInfo data = new E_ItemClientInfo();

            data.EnterpriseID = EnterpriseID;
            data.UserID       = UserID;
            data.PersonalID   = PersonalID;
            data.SetStatus    = Convert.ToInt32(rbIPSStatus.SelectedValue);
            data.SetTarStatus = Convert.ToInt32(rbIPTStatus.SelectedValue);
            data.TotalCount   = num;
            data.IsExchange   = cbIPExchange.Checked ? 1 : 0;

            DataTable dt     = new T_ItemClientInfo().ImportData_IP(data);
            string    result = string.Empty;

            if (dt.Rows[0]["Flag"].ToString().Equals("1"))
            {
                result = string.Format("<span style=\"color:Green;\"> 本次结果:<br/>总数:{0}<span style=\"margin:10px\"> </span>重复:{1}<span style=\"margin:10px\"> </span>导入:{2}</span>", dt.Rows[0]["Total"], dt.Rows[0]["Repeat"], dt.Rows[0]["Num"]);
            }
            else
            {
                result = "<span style=\"color:Red;\">导入失败</span>";
            }
            lblResult.Text = result;
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 页面初始化加载数据
        /// </summary>
        protected void databind()
        {
            //绑定名录状态
            EnumUtil.BindList <MLMGC.DataEntity.Item.EnumClientStatus>(rbStatus);
            rbStatus.Items.RemoveAt(0);                        //删除待分配
            rbStatus.Items.RemoveAt(rbStatus.Items.Count - 2); //删除共享
            rbStatus.SelectedIndex = rbStatus.Items.Count - 1; //默认所有状态选中

            E_ItemClientInfo data = new E_ItemClientInfo();

            data.EnterpriseID = EnterpriceID;

            data.ClientName = Requests.GetQueryString("name");
            txtName.Text    = data.ClientName;

            data.SetStatus         = Requests.GetQueryInt("status", 0);
            rbStatus.SelectedValue = ((int)data.Status).ToString();

            //分页参数
            data.Page           = new MLMGC.DataEntity.E_Page();
            data.Page.PageSize  = pageSize;
            data.Page.PageIndex = pageIndex;

            DataTable dt = new T_ItemClientInfo().LeaderList(data);

            if (dt != null && dt.Rows.Count > 0)//判断是否有数据返回
            {
                //绑定列表
                rpList.DataSource = dt;
                rpList.DataBind();
            }

            //设置分页样式
            pageList1.PageSize              = pageSize;
            pageList1.CurrentPageIndex      = pageIndex;
            pageList1.RecordCount           = data.Page.TotalCount;
            pageList1.CustomInfoHTML        = string.Format("共有记录 <span class='red_font'>{0}</span> 条", pageList1.RecordCount);
            pageList1.TextAfterPageIndexBox = "&nbsp;页/" + pageList1.PageCount + "&nbsp;";
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 绑定页面数据
        /// </summary>
        protected void databind()
        {
            int ciid = Requests.GetQueryInt("ciid", 0);

            Operate1.ClientInfoID = ciid;
            //-----------------绑定基本信息------------------------------
            E_ItemClientInfo data = new T_ItemClientInfo().GetModel(new E_ItemClientInfo()
            {
                EnterpriseID = EnterpriseID, ClientInfoID = ciid, UserID = UserID
            });

            if (data == null)
            {
                Jscript.AlertAndRedirect(this, "无权限查看信息", "/enterprise/clientinfosearch.aspx");
                return;
            }
            #region info的绑定
            lblClientName.Text    = data.ClientName;
            lblAddress.Text       = data.Address;
            lblZipCode.Text       = data.ZipCode;
            lblLinkman.Text       = data.Linkman;
            lblPosition.Text      = data.Position;
            lblEmail.Text         = data.Email;
            lblTel.Text           = data.Tel;
            lblMobile.Text        = data.Mobile;
            hlWebsite.NavigateUrl = data.Website.IndexOf("http://") == -1 ? "http://" + data.Website : data.Website;
            hlWebsite.Text        = data.Website;
            lblFax.Text           = data.Fax;
            lblQQ.Text            = data.QQ;
            lblMSN.Text           = data.MSN;
            lblRemark.Text        = data.Remark;
            #endregion

            txtClientName.Text = data.ClientName;
            txtAddress.Text    = data.Address;
            txtZipCode.Text    = data.ZipCode;
            txtLinkman.Text    = data.Linkman;
            txtPosition.Text   = data.Position;
            txtEmail.Text      = data.Email;
            txtTel.Text        = data.Tel;
            txtWebsite.Text    = data.Website;
            txtMobile.Text     = data.Mobile;
            txtFax.Text        = data.Fax;
            txtQQ.Text         = data.QQ;
            txtMSN.Text        = data.MSN;
            txtRemark.Text     = data.Remark;
            //-----------------绑定名录属性------------------------------
            Property1.SourceID = data.SourceID;
            Property1.TradeID  = data.TradeID;
            Property1.AreaID   = data.AreaID;
            Property2.SourceID = data.SourceID;
            Property2.TradeID  = data.TradeID;
            Property2.AreaID   = data.AreaID;
            //-----------------绑定状态列表------------------------------
            //绑定意向程度
            ddlWish.DataSource = new T_Wish().GetList(new E_Wish()
            {
                EnterpriseID = EnterpriseID
            });
            ddlWish.DataTextField  = "WishName";
            ddlWish.DataValueField = "WishID";
            ddlWish.DataBind();
            //绑定失败理由
            ddlNotTraded.DataSource = new T_NotTraded().GetList(new E_NotTraded()
            {
                EnterpriseID = EnterpriseID
            });
            ddlNotTraded.DataTextField  = "NotTradedName";
            ddlNotTraded.DataValueField = "NotTradedID";
            ddlNotTraded.DataBind();
            //绑定报废理由
            ddlScrap.DataSource = new T_Scrap().GetList(new E_Scrap()
            {
                EnterpriseID = EnterpriseID
            });
            ddlScrap.DataTextField  = "ScrapName";
            ddlScrap.DataValueField = "ScrapID";
            ddlScrap.DataBind();
            //-----------------绑定名录状态------------------------------
            hdStatus.Value             = ((int)data.Status).ToString();
            hdWish.Value               = data.WishID.ToString();
            hdNotTraded.Value          = data.NotTradedID.ToString();
            hdScrap.Value              = data.ScrapID.ToString();
            ddlWish.SelectedValue      = data.WishID.ToString();
            txtMoney.Text              = data.TradedMoney.ToString();
            ddlNotTraded.SelectedValue = data.NotTradedID.ToString();
            ddlScrap.SelectedValue     = data.ScrapID.ToString();
            //----------------绑定沟通记录---------------------
            rpExchangeList.DataSource = new T_ItemExchange().GetList(new E_ItemExchange()
            {
                EnterpriseID = EnterpriseID, ClientInfoID = ciid, UserID = UserID
            });
            rpExchangeList.DataBind();

            txtWdate.Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");


            Operate1.ClientInfoID = ciid;
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 点击确定按钮处理事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            E_ItemClientInfo data = new E_ItemClientInfo();

            data.EnterpriseID = EnterpriseID;
            data.UserID       = UserID;

            data.ClientName = txtName.Text.Trim();
            data.Address    = txtAddress.Text;
            data.ZipCode    = txtZipCode.Text;
            data.Position   = txtPosition.Text;
            data.Linkman    = txtLinkman.Text;
            data.Position   = txtPosition.Text;
            data.Tel        = txtTel.Text.Trim();
            data.Mobile     = txtMobile.Text.Trim();
            data.Fax        = txtFax.Text;
            data.Email      = txtEmail.Text;
            data.QQ         = txtQQ.Text;
            data.MSN        = txtMSN.Text;
            data.Website    = txtWebsite.Text;
            data.SourceCode = trSource.Visible ? txtSourceCode.Text : string.Empty;
            data.TradeCode  = trTrade.Visible ? txtTradeCode.Text : string.Empty;
            data.AreaCode   = trArea.Visible ? txtAreaCode.Text : string.Empty;
            data.Remark     = txtRemark.Text;
            if (string.IsNullOrWhiteSpace(data.ClientName))//判断是否输入名录名称
            {
                Jscript.ShowMsg("请输入名称", this);
                txtName.Focus();
                return;
            }

            /*
             * //添加之前再次确认名录名称、电话、手机是否唯一
             * bool b = true;
             * //判断名录名是否存在
             * b = new T_ClientInfo().Exists(new E_ItemClientInfo() { PersonalID = PersonalID, ClientName = data.ClientName, ClientInfoID = 0 });
             *
             * if (b)
             * {
             *  Jscript.ShowMsg("名录名称已存在!", this);
             *  return;
             * }
             * DataTable dt;
             * b = true;
             * //判断手机是否存在
             * if (!string.IsNullOrEmpty(data.Mobile))
             * {
             *  dt = new T_ClientInfo().ExistsContact(new E_ItemClientInfo { PersonalID = PersonalID, ClientInfoID = 0, Type = 1, Value = data.Mobile });
             *  if (dt == null && Convert.ToInt32(dt.Rows[0]["Flag"]) > -1)
             *  {
             *      b = false;
             *  }
             * }
             *
             * //判断电话是否存在
             * if (!string.IsNullOrEmpty(data.Tel))
             * {
             *  dt = new T_ClientInfo().ExistsContact(new E_ItemClientInfo { PersonalID = PersonalID, ClientInfoID = 0, Type = 2, Value = data.Tel });
             *  if (dt == null && Convert.ToInt32(dt.Rows[0]["Flag"]) > -1)
             *  {
             *      b = false;
             *  }
             * }
             * if (!b)
             * {
             *  Jscript.ShowMsg("录入失败", this);
             *  return;
             * }
             */
            T_ItemClientInfo bll  = new T_ItemClientInfo();
            bool             flag = bll.Add(data);

            if (flag)
            {
                Jscript.AlertAndRedirect(this, "录入成功", Request.Url.ToString());
            }
            else
            {
                Jscript.ShowMsg("录入失败", this);
            }
        }