Ejemplo n.º 1
0
        //新增供应商
        public ActionResult AddGongYing(string supplierLeix, string supplierName, string phone, string chuanzhen, string email, string contacts, string address, string contents)
        {
            GongYingBLL     bll = new GongYingBLL();
            List <supplier> list = bll.Suppliers();
            int             shu = list.Count(); string zhang = shu.ToString();
            string          supplierNum = null;

            if (zhang.Length == 1)
            {
                supplierNum = "00000" + (shu + 1);
            }
            else if (zhang.Length == 2)
            {
                supplierNum = "0000" + (shu + 1);
            }
            else if (zhang.Length == 3)
            {
                supplierNum = "000" + (shu + 1);
            }
            supplier a = new supplier();

            a.supplierNum = supplierNum; a.supplierLeix = supplierLeix; a.supplierName = supplierName; a.phone = phone; a.chuanzhen = chuanzhen;
            a.email       = email; a.contacts = contacts; a.address = address; a.contents = contents; a.isDel = 1;
            bll.Add(a);

            return(Json("新增成功!", JsonRequestBehavior.AllowGet));
        }