Exemple #1
0
        public dynamic UpdateCustomerCubilose()
        {
            int    customerId = Fun.Form("customerId", 0);
            string cubilose   = Fun.Form("cubilose");
            string num        = Fun.Form("num");

            string[]    cubiloseId = cubilose.Split('|');
            string[]    totalNum   = num.Split('|');
            CustomerBLL bll        = new CustomerBLL();

            if (bll.AddCustomerCubilose(customerId, cubiloseId, totalNum, 0))
            {
                return("成功");
            }
            else
            {
                return("失败");
            }
        }
Exemple #2
0
        public dynamic AddCustomerCubilose()
        {
            int    customerId = Fun.Form("customerId", 0);
            int    tradeId    = Fun.Form("tradeId", 0);
            string cubilose   = Fun.Form("cubilose");
            string num        = Fun.Form("num");

            string[]    cubiloseId = cubilose.Split('|');
            string[]    totalNum   = num.Split('|');
            CustomerBLL bll        = new CustomerBLL();

            if (bll.AddCustomerCubilose(customerId, cubiloseId, totalNum, tradeId)) //添加客户物品
            {
                if (new TradeBLL().UpdateTradeStatus(tradeId, 1))                   //修改订单状态
                {
                    CustomerBLL    c        = new CustomerBLL();
                    C_CustomerInfo customer = c.GetCustomer(customerId);
                    if (customer.cu_state == 1)//如果是正常客户,不做操作
                    {
                        return("成功");
                    }
                    else if (customer.cu_state == 0)//潜在客户,更改为正常客户,设置当日为第一次成为正式客户纪念日
                    {
                        return(c.UpdateCustomerState(customerId, 1, DateTime.Now.ToString("yyyy-MM-dd")) ? "成功" : "失败");
                    }
                    else//预警&流失客户恢复正常
                    {
                        return(c.UpdateCustomerState(customerId, 1, "") ? "成功" : "失败");//纪念日穿空值,不做修改
                    }
                }
                else
                {
                    return("失败");
                }
            }
            else
            {
                return("失败");
            }
        }
Exemple #3
0
        public dynamic AddCustomerDelivery()
        {
            int         customerId = Fun.Form("customerId", 0);
            string      time       = Fun.Form("time");
            string      type       = Fun.Form("type");
            string      money      = Fun.Form("money");
            string      name       = Fun.Form("name");
            string      phone      = Fun.Form("phone");
            string      address    = Fun.Form("address");
            string      cubiloses  = Fun.Form("cubilose");
            string      nums       = Fun.Form("num");
            string      GPs        = Fun.Form("GP");
            string      memo       = Fun.Form("memo");
            CustomerBLL bll        = new CustomerBLL();

            if (bll.AddCustomerDelivery(time, type, money, customerId, name, phone, address, cubiloses, nums, GPs, memo))
            {
                string[] cubiloseId = cubiloses.Split('|');
                string[] totalNum   = nums.Split('|');
                for (int i = 0; i < totalNum.Length; i++)
                {
                    totalNum[i] = "-" + totalNum[i];
                }
                if (bll.AddCustomerCubilose(customerId, cubiloseId, totalNum, -1))
                {
                    return("成功");
                }
                else
                {
                    return("失败");
                }
            }
            else
            {
                return("失败");
            }
        }