Example #1
0
        public void UpdateChances(int ChanID, string ChanName, int ChanRate, string ChanLinkMan, string ChanLinkTel, string ChanTitle, string ChanDesc, int ChanCreateMan)
        {
            JavaScriptSerializer json = new JavaScriptSerializer();

            Model.Chances models = new Model.Chances
            {
                ChanID        = ChanID,
                ChanName      = ChanName,
                ChanRate      = ChanRate,
                ChanLinkMan   = ChanLinkMan,
                ChanLinkTel   = ChanLinkTel,
                ChanTitle     = ChanTitle,
                ChanCreateMan = ChanCreateMan,
                ChanDesc      = ChanDesc,
                ChanState     = 1
            };
            try
            {
                bool up = new BLL.Chances().Update(models);
                if (up)
                {
                    Context.Response.Write(json.Serialize(1));
                }
                else
                {
                    Context.Response.Write(json.Serialize(0));
                }
            }
            catch (Exception) {
            }
        }
Example #2
0
        public void UpdateChancesOK(int ChanID)
        {
            JavaScriptSerializer json = new JavaScriptSerializer();


            Model.Chances model = new Model.Chances
            {
                ChanID    = ChanID,
                ChanState = 3,
            };
            int[] a = new int[4];
            a = GetRandomByGuid(a);


            string bh = "KH" + DateTime.Now.ToString("yyyyMMdd");

            for (int j = 0; j < a.Length; j++)
            {
                bh += a[j];
            }

            Model.Chances   add = new BLL.Chances().GetModel(ChanID);
            Model.Customers cus = new Model.Customers
            {
                CusName  = add.ChanName,
                CusID    = bh,
                UserID   = add.ChanDueMan,
                CusState = 1
            };

            bool check = new BLL.Chances().SetChanceSuccess(model);

            if (check)
            {
                bool i = new BLL.Customers().Add(cus);
                if (i)
                {
                    Context.Response.Write(0);
                }
            }
            else
            {
                Context.Response.Write(0);
            }
        }
Example #3
0
        public void UpdateChancesError(int ChanID, string ChanError)
        {
            JavaScriptSerializer json = new JavaScriptSerializer();

            Model.Chances model = new Model.Chances
            {
                ChanID    = ChanID,
                ChanState = 4,
                ChanError = ChanError
            };
            bool check = new BLL.Chances().SetChancesError(model);

            if (check)
            {
                Context.Response.Write(1);
            }
            else
            {
                Context.Response.Write(0);
            }
        }
Example #4
0
        /// <summary>
        /// 分配客户给指派人
        /// </summary>
        /// <param name="ChanID"></param>
        /// <param name="ChanDueMan"></param>
        public void AddChanDueMan(int ChanID, int ChanDueMan)
        {
            JavaScriptSerializer json = new JavaScriptSerializer();

            Model.Chances model = new Model.Chances
            {
                ChanID      = ChanID,
                ChanDueDate = DateTime.Now,
                ChanState   = 2,
                ChanDueMan  = ChanDueMan
            };
            bool check = new BLL.Chances().SetChanDueMan(model);

            if (check)
            {
                Context.Response.Write(1);
            }
            else
            {
                Context.Response.Write(0);
            }
        }
Example #5
0
        public void Bab(string ChanName, int ChanRate, string ChanLinkMan, string ChanLinkTel, string ChanTitle, string ChanDesc, int ChanCreateMan)
        {
            Maticsoft.Model.Chances model = new Model.Chances {
                ChanName      = ChanName,
                ChanRate      = ChanRate,
                ChanLinkMan   = ChanLinkMan,
                ChanLinkTel   = ChanLinkTel,
                ChanTitle     = ChanTitle,
                ChanDesc      = ChanDesc,
                ChanCreateMan = ChanCreateMan,
                ChanState     = 1
            };
            try
            {
                JavaScriptSerializer json = new JavaScriptSerializer();
                int i = new BLL.Chances().Add(model);
                Context.Response.Write(json.Serialize(1));
            }
            catch (Exception) {
                return;

                throw;
            }
        }