Exemplo n.º 1
0
        /// <summary>
        /// 批量更新客服面板成员信息
        /// </summary>
        public void ServicePanel_Update()
        {
            if (!Power("supplier_servicepanel_list", "客服面板"))
            {
                AjaxNoPower();
                return;
            }
            string id = RequestTool.RequestSafeString("Uid");
            List <Lebi_ServicePanel> models = B_Lebi_ServicePanel.GetList("Supplier_id = " + CurrentSupplier.id + " and id in (lbsql{" + id + "})", "");

            foreach (Lebi_ServicePanel model in models)
            {
                model.Sort    = RequestTool.RequestInt("Sort" + model.id + "", 0);
                model.Name    = RequestTool.RequestSafeString("Name" + model.id);
                model.Account = RequestTool.RequestSafeString("Account" + model.id);
                B_Lebi_ServicePanel.Update(model);
            }
            Log.Add("编辑客服成员", "ServicePanel", id.ToString(), CurrentSupplier, id.ToString());
            Response.Write("{\"msg\":\"OK\"}");
        }
Exemplo n.º 2
0
        /// <summary>
        /// 编辑客服面板成员信息
        /// </summary>
        public void ServicePanel_Edit()
        {
            if (!Power("supplier_servicepanel_list", "客服面板"))
            {
                AjaxNoPower();
                return;
            }
            int  id                 = RequestTool.RequestInt("id", 0);
            bool addflag            = false;
            Lebi_ServicePanel model = B_Lebi_ServicePanel.GetModel(id);

            if (model == null)
            {
                addflag = true;
                model   = new Lebi_ServicePanel();
            }
            model                       = B_Lebi_ServicePanel.SafeBindForm(model);
            model.Name                  = RequestTool.RequestSafeString("Name");
            model.Account               = RequestTool.RequestSafeString("Account");
            model.Language_ids          = RequestTool.RequestSafeString("Language_ids");
            model.ServicePanel_Type_id  = RequestTool.RequestInt("ServicePanel_Type_id", 0);
            model.ServicePanel_Group_id = RequestTool.RequestInt("ServicePanel_Group_id", 0);
            model.Sort                  = RequestTool.RequestInt("Sort", 0);
            model.Supplier_id           = CurrentSupplier.id;
            if (addflag)
            {
                B_Lebi_ServicePanel.Add(model);
                id = B_Lebi_ServicePanel.GetMaxId();
                Log.Add("添加客服成员", "ServicePanel", id.ToString(), CurrentSupplier, model.Name);
            }
            else
            {
                B_Lebi_ServicePanel.Update(model);
                Log.Add("编辑客服成员", "ServicePanel", id.ToString(), CurrentSupplier, model.Name);
            }
            string result = "{\"msg\":\"OK\", \"id\":\"" + id + "\"}";

            Response.Write(result);
        }