Esempio n. 1
0
        /// <summary>
        /// 批量更新客服面板部门信息
        /// </summary>
        public void ServicePanel_Group_Update()
        {
            if (!Power("supplier_servicepanel_list", "客服面板"))
            {
                AjaxNoPower();
                return;
            }
            string id = RequestTool.RequestSafeString("Uid");
            List <Lebi_ServicePanel_Group> models = B_Lebi_ServicePanel_Group.GetList("Supplier_id = " + CurrentSupplier.id + " and id in (lbsql{" + id + "})", "");

            foreach (Lebi_ServicePanel_Group model in models)
            {
                model.Sort = RequestTool.RequestInt("Sort" + model.id + "", 0);
                model.Name = RequestTool.RequestSafeString("Name" + model.id);
                B_Lebi_ServicePanel_Group.Update(model);
            }
            Log.Add("编辑客服部门", "ServicePanel_Group", id.ToString(), CurrentSupplier, id.ToString());
            Response.Write("{\"msg\":\"OK\"}");
        }
Esempio n. 2
0
        /// <summary>
        /// 编辑客服面板部门信息
        /// </summary>
        public void ServicePanel_Group_Edit()
        {
            if (!Power("supplier_servicepanel_list", "客服面板"))
            {
                AjaxNoPower();
                return;
            }
            int  id      = RequestTool.RequestInt("id", 0);
            bool addflag = false;
            Lebi_ServicePanel_Group model = B_Lebi_ServicePanel_Group.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id);

            if (model == null)
            {
                addflag = true;
                model   = new Lebi_ServicePanel_Group();
            }
            model              = B_Lebi_ServicePanel_Group.SafeBindForm(model);
            model.Name         = RequestTool.RequestSafeString("Name");
            model.Language_ids = RequestTool.RequestSafeString("Language_ids");
            model.Sort         = RequestTool.RequestInt("Sort", 0);
            if (addflag)
            {
                model.Supplier_id = CurrentSupplier.id;
                B_Lebi_ServicePanel_Group.Add(model);
                id = B_Lebi_ServicePanel_Group.GetMaxId();
                Log.Add("添加客服部门", "ServicePanel_Group", id.ToString(), CurrentSupplier, model.Name);
            }
            else
            {
                B_Lebi_ServicePanel_Group.Update(model);
                Log.Add("编辑客服部门", "ServicePanel_Group", id.ToString(), CurrentSupplier, model.Name);
            }
            string result = "{\"msg\":\"OK\", \"id\":\"" + id + "\"}";

            Response.Write(result);
        }