예제 #1
0
        public ActionResult PopupboxForReply(CustomerServCenter model, Dictionary <string, string> queryvalues)
        {
            var a = model.CSCMainID;


            model.GUName   = "客服";
            model.GUType   = 2;
            model.GUUserID = 0;

            model.CSCSubId = model.CSCMainID;
            model.CSCState = cscState.未处理;
            model.CSCTime  = DateTime.Now;


            int result = CustomerServCenterBLL.Insert(model);

            if (result > 0)
            {
                CustomerServCenter c = new CustomerServCenter {
                    CSCUpdateTime = DateTime.Now, CSCMainID = model.CSCMainID, CSCState = cscState.已回复
                };
                int r = CustomerServCenterBLL.UpdateForManage(c);

                return(Json(new { result = 0 }));
            }
            else
            {
                return(Json(new { result = 1 }));
            }
        }
예제 #2
0
        public object Post([FromBody] CustomerServCenter model)
        {
            //var a = model.CSCMainID;

            model.GUName   = "管理员";
            model.GUType   = 1;
            model.GUUserID = 0;
            model.CSCSubId = model.CSCMainID;
            model.CSCState = cscState.未处理;
            model.CSCTime  = DateTime.Now;

            int result = CustomerServCenterBLL.Insert(model);

            if (result > 0)
            {
                CustomerServCenter c = new CustomerServCenter {
                    CSCMainID = model.CSCMainID, CSCState = cscState.已回复
                };
                int r = CustomerServCenterBLL.UpdateForManage(c);

                return(new { result = 0 });
            }
            else
            {
                return(new { result = 1 });
            }
        }
예제 #3
0
        public object Delete([FromBody] CustomerServCenter model)
        {
            int result = CustomerServCenterBLL.Delete(model);

            if (result > 0)
            {
                return(new { result = 0 });
            }
            return(new { result = 1 });
        }
예제 #4
0
        internal static CustomerServCenter GetModel(CustomerServCenter model)
        {
            using (var cn = new MySqlConnection(sqlconnectionString))
            {
                cn.Open();
                IEnumerable <CustomerServCenter> csc = cn.Query <CustomerServCenter>(@"select * from CustomerServCenter where CSCMainID = @CSCMainID", model);
                cn.Close();

                return(csc.FirstOrDefault());
            }
        }
예제 #5
0
        internal static IEnumerable <CustomerServCenter> GetListWithCSCSubId(CustomerServCenter cust)
        {
            using (var cn = new MySqlConnection(sqlconnectionString))
            {
                cn.Open();
                IEnumerable <CustomerServCenter> csc = cn.Query <CustomerServCenter>(@"select * from CustomerServCenter where CSCMainID = @CSCMainID or CSCSubId = @CSCMainID order by CSCMainID asc", cust);
                cn.Close();

                return(csc);
            }
        }
예제 #6
0
        internal static int Update(CustomerServCenter c)
        {
            using (var cn = new MySqlConnection(sqlconnectionString))
            {
                cn.Open();

                int i = cn.Execute(@"update CustomerServCenter set CSCState = @CSCState where CSCMainID = @CSCMainID and GUUserID = @GUUserID", c);

                cn.Close();

                return(i);
            }
        }
예제 #7
0
        internal static int Insert(CustomerServCenter cust)
        {
            using (var cn = new MySqlConnection(sqlconnectionString))
            {
                cn.Open();

                int i = cn.Execute(@"insert into CustomerServCenter(CSCSubId,GUUserID,CSCTime,CSCTitle,CSCType,CSCContent,CSCState,GUName,GUType)values (@CSCSubId,@GUUserID,@CSCTime,@CSCTitle,@CSCType,@CSCContent,@CSCState,@GUName,@GUType)", cust);

                cn.Close();

                return(i);
            }
        }
예제 #8
0
        internal static int UpdateForManage(CustomerServCenter c)
        {
            using (var cn = new MySqlConnection(sqlconnectionString))
            {
                cn.Open();

                int i = cn.Execute(@"update CustomerServCenter set CSCUpdateTime='" + DateTime.Now.ToString() + "', CSCState = @CSCState where CSCMainID = @CSCMainID", c);

                cn.Close();

                return(i);
            }
        }
예제 #9
0
        internal static int Delete(CustomerServCenter cust)
        {
            using (var cn = new MySqlConnection(sqlconnectionString))
            {
                cn.Open();

                int i = cn.Execute(@"Delete from CustomerServCenter where CSCMainID = @CSCMainID or CSCSubId = @CSCMainID", cust);

                cn.Close();

                return(i);
            }
        }
예제 #10
0
        public ActionResult PopupboxForReply(Dictionary <string, string> queryvalues)
        {
            int CSCMainID = queryvalues.ContainsKey("CSCMainID") ? Convert.ToInt32(queryvalues["CSCMainID"]) : 0;

            if (CSCMainID > 0)
            {
                //CustomerServCenter res = CustomerServCenterBLL.GetModel(new CustomerServCenter { CSCMainID = CSCMainID });

                IEnumerable <CustomerServCenter> result = CustomerServCenterBLL.GetListWithCSCSubId(new CustomerServCenter {
                    CSCMainID = CSCMainID
                });
                CustomerServCenter res = result.Where(x => x.CSCMainID == CSCMainID).FirstOrDefault();

                ViewData["res"] = res;
                return(View(result));
            }
            return(View());
        }
예제 #11
0
        public object Post(int id, [FromBody] CustomerServCenter cust)
        {
            if (cust.GUUserID == 0)
            {
                return(new { result = 1 });
            }
            if (string.IsNullOrWhiteSpace(cust.GUName))
            {
                return(new { result = 1 });
            }
            if (string.IsNullOrWhiteSpace(cust.CSCContent))
            {
                return(new { result = 1 });
            }
            if (cust.CSCContent.Length < 20 || cust.CSCContent.Length > 500)
            {
                return(new { result = 1 });
            }

            //cust.CSCMainID = id;
            cust.GUType   = 0;
            cust.CSCSubId = id;
            cust.CSCState = cscState.未处理;
            cust.CSCTime  = DateTime.Now;



            int result = CustomerServCenterBLL.Insert(cust);

            if (result > 0)
            {
                CustomerServCenter c = new CustomerServCenter {
                    CSCMainID = id, CSCState = cscState.未处理, GUUserID = cust.GUUserID
                };
                int r = CustomerServCenterBLL.Update(c);

                return(new { result = 0 });
            }
            else
            {
                return(new { result = 1 });
            }
        }
예제 #12
0
        public object Post([FromBody] CustomerServCenter cust)
        {
            if (cust.GUUserID == 0)
            {
                return(new { result = 1 });
            }
            if (string.IsNullOrWhiteSpace(cust.GUName))
            {
                return(new { result = 1 });
            }
            if (string.IsNullOrWhiteSpace(cust.CSCTitle))
            {
                return(new { result = 1 });
            }
            if (string.IsNullOrWhiteSpace(cust.CSCContent))
            {
                return(new { result = 1 });
            }
            if (cust.CSCTitle.Length < 4 || cust.CSCTitle.Length > 20)
            {
                return(new { result = 1 });
            }
            if (cust.CSCContent.Length < 20 || cust.CSCContent.Length > 500)
            {
                return(new { result = 1 });
            }

            cust.GUType   = 0;
            cust.CSCSubId = 0;
            cust.CSCState = cscState.未处理;
            cust.CSCTime  = DateTime.Now;

            int result = CustomerServCenterBLL.Insert(cust);

            if (result > 0)
            {
                return(new { result = 0 });
            }
            else
            {
                return(new { result = 1 });
            }
        }
예제 #13
0
        // GET: a222
        public object Post(int id, [FromBody] CustomerServCenter cust)
        {
            if (cust.CSCState != cscState.已解决)
            {
                return(new { result = 1 });
            }
            CustomerServCenter c = new CustomerServCenter {
                CSCMainID = id, CSCState = cust.CSCState, GUUserID = cust.GUUserID
            };
            int result = CustomerServCenterBLL.Update(c);

            if (result > 0)
            {
                return(new { result = 0 });
            }
            else
            {
                return(new { result = 1 });
            }
        }
예제 #14
0
        // GET: a222
        public object Post(int id, [FromBody] CustomerServCenter cust)
        {
            //if (cust.CSCState != 3)
            //{
            //    return new { result = 1 };
            //}
            CustomerServCenter c = new CustomerServCenter {
                CSCMainID = id, CSCState = cust.CSCState, GUUserID = cust.GUUserID
            };
            int result = Data.BLL.CustomerServCenterBLL.Update(c);

            if (result > 0)
            {
                return(new { result = 0 });
            }
            else
            {
                return(new { result = 1 });
            }
        }
예제 #15
0
 internal static int Update(CustomerServCenter c)
 {
     return(Data.DAL.CustomerServCenterDAL.Update(c));
 }
예제 #16
0
 public static CustomerServCenter GetModel(CustomerServCenter model)
 {
     return(DAL.CustomerServCenterDAL.GetModel(model));
 }
예제 #17
0
 public static IEnumerable <CustomerServCenter> GetListWithCSCSubId(CustomerServCenter cust)
 {
     return(DAL.CustomerServCenterDAL.GetListWithCSCSubId(cust));
 }
예제 #18
0
 public static int Delete(CustomerServCenter cust)
 {
     return(DAL.CustomerServCenterDAL.Delete(cust));
 }
예제 #19
0
 public static int Update(CustomerServCenter model)
 {
     return(DAL.CustomerServCenterDAL.Update(model));
 }
예제 #20
0
 public static int Insert(CustomerServCenter model)
 {
     return(DAL.CustomerServCenterDAL.Insert(model));
 }
예제 #21
0
 internal static int Insert(CustomerServCenter cust)
 {
     return(Data.DAL.CustomerServCenterDAL.Insert(cust));
 }
예제 #22
0
 public static int UpdateForManage(CustomerServCenter c)
 {
     return(DAL.CustomerServCenterDAL.UpdateForManage(c));
 }