Ejemplo n.º 1
0
        /// <summary>
        /// 编辑自提点
        /// </summary>
        public void pickup_Edit()
        {
            if (!Power("pickup_manage", "管理自提点"))
            {
                AjaxNoPower();
                return;
            }
            int         id      = RequestTool.RequestInt("id", 0);
            bool        addflag = false;
            Lebi_PickUp model   = B_Lebi_PickUp.GetModel(id);

            if (model == null)
            {
                addflag           = true;
                model             = new Lebi_PickUp();
                model.Supplier_id = CurrentSupplier.id;
            }
            model = B_Lebi_PickUp.BindForm(model);

            if (addflag)
            {
                B_Lebi_PickUp.Add(model);
                id = B_Lebi_PickUp.GetMaxId();
                Log.Add("添加自提点", "PickUp", id.ToString(), CurrentSupplier, model.Name);
            }
            else
            {
                if (model.Supplier_id != CurrentSupplier.id)
                {
                    Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                    return;
                }
                B_Lebi_PickUp.Update(model);
                Log.Add("编辑自提点", "PickUp", id.ToString(), CurrentSupplier, model.Name);
            }
            Response.Write("{\"msg\":\"OK\"}");
        }