Beispiel #1
0
        public ActionResult LoadMenuMX(int CATALOGID)
        {
            token = appClass.CRM_Gettoken();

            CRM_QYJS_MENU menu = crmModels.QYJS_MENU.ReadbyID(CATALOGID, token);

            ViewBag.NAME = menu.NAME;

            CRM_QYJS_FILE model = new CRM_QYJS_FILE();

            model.CATALOGID = CATALOGID;
            model.MOBILE    = 1;
            CRM_QYJS_FILE[] data    = crmModels.QYJS_FILE.ReadByParam(model, token);
            string          netpath = System.Configuration.ConfigurationManager.AppSettings["NETPATH"];

            for (int i = 0; i < data.Length; i++)
            {
                if (data[i].ML != "")
                {
                    string[] p     = data[i].ML.Split('\\');
                    int      count = p.Length - 1;
                    string   path  = p[count - 2] + @"/" + p[count - 1] + @"/" + p[count];
                    data[i].ML = netpath + path;
                }
            }
            ViewBag.data = data;
            return(View());
        }
        public string Data_Select_AllMenu()             //查询出所有菜单     然后转成树状结构
        {
            token = appClass.CRM_Gettoken();
            CRM_QYJS_MENU model = new CRM_QYJS_MENU();

            CRM_QYJS_MENU[] data   = crmModels.QYJS_MENU.ReadTTbyParam(model, token);
            LayuiTree[]     result = new LayuiTree[data.Length];

            string netpath = System.Configuration.ConfigurationManager.AppSettings["NETPATH"];

            for (int i = 0; i < data.Length; i++)           //把查询出来的数据转换成layui属性列表要求的格式,顺便把图片的路径改成网络路径
            {
                result[i]       = new LayuiTree();
                result[i].Id    = data[i].CATALOGID;
                result[i].Pid   = data[i].PLOGID;
                result[i].title = data[i].NAME;

                if (data[i].ML != "")
                {
                    string[] p     = data[i].ML.Split('\\');
                    int      count = p.Length - 1;
                    string   path  = p[count - 2] + @"/" + p[count - 1] + @"/" + p[count];
                    data[i].ML = netpath + path;
                }
            }
            string s = Newtonsoft.Json.JsonConvert.SerializeObject(result);

            return(s);
        }
Beispiel #3
0
        public ActionResult Promotion()
        {
            token = appClass.CRM_Gettoken();

            CRM_QYJS_MENU model = new CRM_QYJS_MENU();

            model.PLOGID = 4;
            CRM_QYJS_MENU[] data = crmModels.QYJS_MENU.ReadTTbyParam(model, token);
            ViewBag.data = data;
            return(View());
        }
        public ActionResult Product()
        {
            Session["location"] = 88;
            token = appClass.CRM_Gettoken();

            CRM_QYJS_MENU model = new CRM_QYJS_MENU();

            model.PLOGID = 3;
            CRM_QYJS_MENU[] data = crmModels.QYJS_MENU.ReadTTbyParam(model, token);
            ViewBag.data = data;
            return(View());
        }
Beispiel #5
0
        public string Data_SelectByID(int CATALOGID)
        {
            token = appClass.CRM_Gettoken();
            CRM_QYJS_MENU data    = crmModels.QYJS_MENU.ReadbyID(CATALOGID, token);
            string        netpath = System.Configuration.ConfigurationManager.AppSettings["NETPATH"];

            if (data.ML != "")
            {
                string[] p     = data.ML.Split('\\');
                int      count = p.Length - 1;
                string   path  = p[count - 2] + @"/" + p[count - 1] + @"/" + p[count];
                data.ML = netpath + path;
            }

            return(Newtonsoft.Json.JsonConvert.SerializeObject(data));
        }
Beispiel #6
0
        public string Data_SelectByParam(string cxdata)
        {
            token = appClass.CRM_Gettoken();
            CRM_QYJS_MENU model = Newtonsoft.Json.JsonConvert.DeserializeObject <CRM_QYJS_MENU>(cxdata);

            CRM_QYJS_MENU[] data    = crmModels.QYJS_MENU.ReadTTbyParam(model, token);
            string          netpath = System.Configuration.ConfigurationManager.AppSettings["NETPATH"];

            for (int i = 0; i < data.Length; i++)           //把查询出来的数据转换成layui属性列表要求的格式,顺便把图片的路径改成网络路径
            {
                if (data[i].ML != "")
                {
                    string[] p     = data[i].ML.Split('\\');
                    int      count = p.Length - 1;
                    string   path  = p[count - 2] + @"/" + p[count - 1] + @"/" + p[count];
                    data[i].ML = netpath + path;
                }
            }
            return(Newtonsoft.Json.JsonConvert.SerializeObject(data));
        }
Beispiel #7
0
        public string Data_Insert_Menu(string data)
        {
            token = appClass.CRM_Gettoken();
            CRM_QYJS_MENU model = Newtonsoft.Json.JsonConvert.DeserializeObject <CRM_QYJS_MENU>(data);

            model.CJR = appClass.CRM_GetStaffid();
            int i = crmModels.QYJS_MENU.Create(model, token);

            if (i > 0)
            {
                webmsg.KEY = i;
                webmsg.MSG = "新增成功!";
            }
            else
            {
                webmsg.KEY = 0;
                webmsg.MSG = "新增失败!";
            }
            return(Newtonsoft.Json.JsonConvert.SerializeObject(webmsg));
        }
        public string Data_Insert_MenuImg(int CATALOGID)        //上传照片
        {
            var file = Request.Files[0];

            string date     = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss.fff");
            string fileName = "cp_" + date;
            string year     = DateTime.Now.Year.ToString();
            string month    = DateTime.Now.Month.ToString();

            string gotname = file.FileName;

            string[] name = gotname.Split('.');

            int    count     = name.Length - 1;
            string Path_Data = FileSavePath + @"\upload\QYJS" + @"\file\" + fileName + "." + name[count];
            string Path      = FileSavePath2 + @"\\upload\\QYJS" + @"\\file\\" + fileName + "." + name[count];
            string netpath   = System.Configuration.ConfigurationManager.AppSettings["NETPATH"] + @"QYJS\/" + @"file\/" + fileName + "." + name[count];

            file.SaveAs(Path);
            FileInfo fi = new FileInfo(Path);

            if (fi.Exists == true)
            {
                if (CATALOGID != 0)
                {
                    token = appClass.CRM_Gettoken();
                    CRM_QYJS_MENU data = crmModels.QYJS_MENU.ReadbyID(CATALOGID, token);
                    data.ML = Path_Data;
                    crmModels.QYJS_MENU.Update(data, token);
                }


                string json = "{\"code\":0,\"res\":\"" + netpath + "\",\"locapath\":\"" + Path + "\"}";
                return(json);
            }
            else
            {
                return("");
            }
        }
Beispiel #9
0
        public ActionResult LoadDownMenu(int CATALOGID)
        {
            token = appClass.CRM_Gettoken();

            CRM_QYJS_MENU model = new CRM_QYJS_MENU();

            model.PLOGID = CATALOGID;
            CRM_QYJS_MENU[] data    = crmModels.QYJS_MENU.ReadTTbyParam(model, token);
            string          netpath = System.Configuration.ConfigurationManager.AppSettings["NETPATH"];

            for (int i = 0; i < data.Length; i++)
            {
                if (data[i].ML != "")
                {
                    string[] p     = data[i].ML.Split('\\');
                    int      count = p.Length - 1;
                    string   path  = p[count - 2] + @"/" + p[count - 1] + @"/" + p[count];
                    data[i].ML = netpath + path;
                }
            }
            ViewBag.data = data;

            return(View());
        }
Beispiel #10
0
        public string Data_Update_Menu(string data)
        {
            token = appClass.CRM_Gettoken();
            CRM_QYJS_MENU model = Newtonsoft.Json.JsonConvert.DeserializeObject <CRM_QYJS_MENU>(data);

            model.XGR = appClass.CRM_GetStaffid();
            if (model.ML == "")
            {
                model.ML = crmModels.QYJS_MENU.ReadbyID(model.CATALOGID, token).ML;
            }
            int i = crmModels.QYJS_MENU.Update(model, token);

            if (i > 0)
            {
                webmsg.KEY = i;
                webmsg.MSG = "修改成功!";
            }
            else
            {
                webmsg.KEY = 0;
                webmsg.MSG = "修改失败!";
            }
            return(Newtonsoft.Json.JsonConvert.SerializeObject(webmsg));
        }
Beispiel #11
0
 public CRM_QYJS_MENU[] ReadTTbyParam(CRM_QYJS_MENU model, string ptoken)
 {
     return(client.ReadTTbyParam(model, ptoken));
 }
Beispiel #12
0
 public int Update(CRM_QYJS_MENU model, string ptoken)
 {
     return(client.Update(model, ptoken));
 }