Esempio n. 1
0
 public ActionResult Users()
 {
     token = appClass.CRM_Gettoken();
     CRM_HG_STAFFKHLX[] data = crmModels.HG_STAFFKHLX.Read(token);
     ViewData.Model = data;
     return(View());
 }
Esempio n. 2
0
        public string GET_TMINFO(string datastring)
        {
            string        token = appClass.CRM_Gettoken();
            MES_TM_TMINFO model_MES_TM_TMINFO = Newtonsoft.Json.JsonConvert.DeserializeObject <MES_TM_TMINFO>(datastring);

            model_MES_TM_TMINFO.TMLB = 1;
            SELECT_MES_TM_TMINFO_BYTM rst_SELECT_MES_TM_TMINFO_BYTM = mesModels.TM_TMINFO.SELECT(model_MES_TM_TMINFO, token);

            return(Newtonsoft.Json.JsonConvert.SerializeObject(rst_SELECT_MES_TM_TMINFO_BYTM));
        }
Esempio n. 3
0
        public int Insert_Wl(string data)
        {
            token = appClass.CRM_Gettoken();
            CRM_WL_TT model = JsonConvert.DeserializeObject <CRM_WL_TT>(data);

            model.ISACTIVE = 1;
            int i = crmModels.WL_TT.Create(model, token);

            return(i);
        }
Esempio n. 4
0
 public ActionResult CODING()
 {
     Session["location"] = 11003;
     token = appClass.CRM_Gettoken();
     CRM_HG_DICT[] DATA = crmModels.HG_DICT.Read(128, 0, token);
     ViewBag.DATA          = DATA;
     ViewBag.START         = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd");
     ViewBag.END           = DateTime.Now.ToString("yyyy-MM-dd");
     ViewBag.RemoteAddress = RemoteAddress;
     return(View());
 }
Esempio n. 5
0
        public string GetData_Wl(string cxdata)
        {
            token = appClass.CRM_Gettoken();
            CRM_WL_TT model = Newtonsoft.Json.JsonConvert.DeserializeObject <CRM_WL_TT>(cxdata);

            CRM_WL_TT[] data = crmModels.WL_TT.ReadByParam(model, token);
            return(Newtonsoft.Json.JsonConvert.SerializeObject(data));
        }
Esempio n. 6
0
        public ActionResult CK_Setting()
        {
            Session["location"] = 20000;
            token = appClass.CRM_Gettoken();
            MES_SY_TYPEMX cx_ljxt = new MES_SY_TYPEMX();

            cx_ljxt.TYPEID = 39;
            MES_SY_TYPEMXLIST[] LJXT = mesModels.SY_TYPEMX.SELECT(cx_ljxt, token);
            ViewBag.LJXT = LJXT;

            MES_SY_GC cx_gc = new MES_SY_GC();

            cx_gc.STAFFID = appClass.CRM_GetStaffid();
            MES_SY_GC[] GC = mesModels.SY_GC.SELECT_BY_ROLE(cx_gc, token);
            ViewBag.GC = GC;

            return(View());
        }
Esempio n. 7
0
        public string SY_DICT_Read(string data)
        {
            token = appClass.CRM_Gettoken();
            FIVES_SY_DICT model = Newtonsoft.Json.JsonConvert.DeserializeObject <FIVES_SY_DICT>(data);

            FIVES_SY_DICT[] res = fivesmodels.SY_DICT.Read(model, token);
            //HR_SY_DEPT_SELECT r = hrmodels.SY_DEPT.SELECT(new HR_SY_DEPT(), token);

            return(Newtonsoft.Json.JsonConvert.SerializeObject(res));
        }
Esempio n. 8
0
        public ActionResult Show_Notice(int NOTICETTID)
        {
            token = appClass.CRM_Gettoken();
            CRM_MSG_NOTICETTList TTdata = crmModels.MSG_NOTICE.ReadTTbyTTID(NOTICETTID, token);

            CRM_HG_WJJL[] FJdata  = crmModels.HG_WJJL.Read(12, NOTICETTID, token);
            string        netpath = System.Configuration.ConfigurationManager.AppSettings["NETPATH"];

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

            ViewBag.FJdata = FJdata;
            ViewBag.TTdata = TTdata;

            return(View());
        }
Esempio n. 9
0
        public ActionResult TMPrint_GL()
        {
            Session["location"] = 21001;
            token = appClass.CRM_Gettoken();
            MES_SY_TYPEMX cx_ljxt = new MES_SY_TYPEMX();

            cx_ljxt.TYPEID = 43;
            MES_SY_TYPEMXLIST[] TYPE = mesModels.SY_TYPEMX.SELECT(cx_ljxt, token);
            ViewBag.TYPE = TYPE;


            cx_ljxt.TYPEID = 44;
            MES_SY_TYPEMXLIST[] PAPER = mesModels.SY_TYPEMX.SELECT(cx_ljxt, token);
            ViewBag.PAPER = PAPER;
            return(View());
        }
Esempio n. 10
0
        public int Data_Insert_QingJia(string data)
        {
            token = appClass.CRM_Gettoken();
            CRM_KQ_YGQJ model = JsonConvert.DeserializeObject <CRM_KQ_YGQJ>(data);
            int         i     = crmModels.KQ_YGQJ.Create(model, token);


            return(i);
        }
Esempio n. 11
0
        public int Data_Insert_BFDJ(string data)
        {
            token = appClass.CRM_Gettoken();
            CRM_BF_BFDJ model = Newtonsoft.Json.JsonConvert.DeserializeObject <CRM_BF_BFDJ>(data);

            model.JHBFKSSJ = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            if (model.ISACTIVE == 1)
            {
                model.JHBFJSSJ = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            }
            else
            {
                model.JHBFJSSJ = "";
            }
            int i = crmModels.BF_BF.Create_BFDJ(model, token);

            return(i);
        }
Esempio n. 12
0
        public string READ_TMINFO(string data)
        {
            token = appClass.CRM_Gettoken();
            var url         = section + "api/WMS/BC_TM/READ";
            var restClient  = new RestClient(url);
            var restRequest = new RestRequest(Method.POST);

            restRequest.AddHeader("Sonluk-Token", token);
            restRequest.RequestFormat = DataFormat.Json;
            restRequest.AddBody(data);
            var response = restClient.Execute(restRequest);
            var jsonData = (JObject)JsonConvert.DeserializeObject(response.Content);

            return(Newtonsoft.Json.JsonConvert.SerializeObject(jsonData));
        }
Esempio n. 13
0
        public ActionResult SYS_Info()
        {
            token = appClass.CRM_Gettoken();
            Session["location"] = 557;
            MSG_MSG_TYPE cxmodel = new MSG_MSG_TYPE();

            MSG_MSG_TYPE[] MSGTYPE = msgModels.MSG_TYPE.ReadByParam(cxmodel, token);
            ViewBag.MSGTYPE = MSGTYPE;

            CRM_HG_DICT[] MODE = crmModels.HG_DICT.Read(116, 0, token);
            ViewBag.MODE = MODE;
            return(View());
        }
Esempio n. 14
0
        public ActionResult BHGDJ()
        {
            Session["location"] = 212;
            token = appClass.CRM_Gettoken();


            FIVES_STAFF_DEP DEPmodel = new FIVES_STAFF_DEP();

            DEPmodel.STAFFID = appClass.CRM_GetStaffid();

            FIVES_STAFF_DEP[] DEPdata = fivesmodels.STAFF_DEP.Read(DEPmodel, token);

            List <FIVES_STAFF_DEP> DEPlist = DEPdata.ToList();

            DEPlist         = DEPlist.DistinctBy(p => p.DEPTID).ToList();
            DEPdata         = DEPlist.ToArray();
            ViewBag.DeptArr = DEPdata;


            return(View());
        }
Esempio n. 15
0
        public ActionResult ElectricInvoice()
        {
            Session["location"] = 11000;
            ViewBag.STAFFNAME   = Session["NAME"];
            ViewBag.YEAR        = DateTime.Now.Year;

            token = appClass.CRM_Gettoken();
            int             STAFFID = Convert.ToInt32(Session["STAFFID"].ToString());
            HR_SY_GS_SELECT GCData  = hrmodels.SY_GS.SELECT_BY_ROLE(STAFFID, token);

            ViewBag.GCData = GCData;
            return(View());
        }
Esempio n. 16
0
        public string Data_Insert_Product(string data)
        {
            token = appClass.CRM_Gettoken();
            CRM_PRODUCT_PRODUCT model = Newtonsoft.Json.JsonConvert.DeserializeObject <CRM_PRODUCT_PRODUCT>(data);

            model.CJR      = appClass.CRM_GetStaffid();
            model.ISACTIVE = 1;
            int i = crmModels.PRODUCT_PRODUCT.Create(model, token);

            webmsg.KEY = i;
            if (i > 0)
            {
                webmsg.MSG = "新增成功";
            }
            else
            {
                webmsg.MSG = "新增失败!";
            }
            return(Newtonsoft.Json.JsonConvert.SerializeObject(webmsg));
        }
Esempio n. 17
0
        public ActionResult ScanFAHUO_JHDPart(string VBELN)
        {
            token = appClass.CRM_Gettoken();
            MODEL_ZBCFUN_JHD_READ data = crmModels.BarCode.JHD_READ(VBELN, token);

            ViewBag.data = data;
            CRM_BC_FXCHMX cx_fxch = new CRM_BC_FXCHMX();

            cx_fxch.VBELN = VBELN;
            CRM_BC_FXCHMX[] FXCHdata = crmModels.BC_FXCH.ReadMXbyParam(cx_fxch, token);
            ViewBag.FXCHdata = FXCHdata;
            return(View());
        }
Esempio n. 18
0
        public ActionResult Insert_Order()
        {
            token = appClass.CRM_Gettoken();
            CRM_HG_STAFF STAFF = crmModels.HG_STAFF.ReadBySTAFFID(appClass.CRM_GetStaffid(), token);    //STAFF为当前用户的数据

            ViewBag.STAFF = STAFF;

            string SAPSN = STAFF.STAFFNO;

            CRM_KH_KH[] SDF = crmModels.KH_KH.ReadSDFbyPKH(SAPSN, token);
            ViewBag.SDF = SDF;

            CRM_KH_KH KH = crmModels.KH_KH.ReadBySAPSN(SAPSN, token);     //kh为当前客户的数据

            ViewBag.KH = KH;

            DateTime now = DateTime.Now;

            ViewBag.startdate = now.AddMonths(-1).ToString("yyyy-MM-dd");
            ViewBag.enddate   = now.ToString("yyyy-MM-dd");

            return(View());
        }
Esempio n. 19
0
        public int Data_Insert_Dep(string data)        //新建部门
        {
            token = appClass.CRM_Gettoken();
            CRM_HG_DEPT model = Newtonsoft.Json.JsonConvert.DeserializeObject <CRM_HG_DEPT>(data);
            int         i     = crmModels.HG_DEPT.Create(model, token);

            return(i);
        }
Esempio n. 20
0
        public string Data_Insert_PM(string data, string isTuiHuo)
        {
            token = appClass.CRM_Gettoken();
            try
            {
                CRM_BC_PMLIST model = Newtonsoft.Json.JsonConvert.DeserializeObject <CRM_BC_PMLIST>(data);
                model.CJR = appClass.CRM_GetStaffid();
                CRM_BC_PMLISTList[] xianyouData = crmModels.BC_PMLIST.SelectByGD(model.AUFNR, token);
                if (xianyouData.Length != 0)    //已经有该工单的数据
                {
                    if (xianyouData[0].CHARG != model.CHARG)
                    {
                        return("已存在该工单,且日期唛不一致");
                    }
                    if (xianyouData[0].PM == "" && xianyouData[xianyouData.Length - 1].PM == "") //数据库里有该工单的信息,但箱码还未生成喷码
                    {
                        int error = crmModels.BC_PMLIST.UpdatePM(token);                         //生成喷码
                        if (error != 0)
                        {
                            return("喷码生成失败,请重试");
                        }
                    }
                    else         //该工单的箱码已经生成了喷码
                    {
                        MODEL_ZBCFUN_TM_READ TMmodel = crmModels.BarCode.GET_ZBCFUN_TM_READ(model.AUFNR, "F", token);
                        if (TMmodel.ET_TM.Length == 0)
                        {
                            return("该工单没有所属箱码");
                        }

                        List <ZSL_BCT100> ET_TM = TMmodel.ET_TM.ToList();
                        //ET_TM = (from o in ET_TM orderby (o.DXM.Substring(2,o.DXM.Length-2)) select o).ToList();
                        ET_TM = ET_TM.OrderBy(u => u.TPM.Substring(2, u.TPM.Length - 2)).ThenBy(u => u.DXM.Substring(2, u.DXM.Length - 2)).ToList();

                        string PM = "";
                        if (isTuiHuo == "1")       //如果是退货的话喷码统一为ZAA
                        {
                            PM = "ZAA";
                        }
                        string TPM_temp = "";
                        int    isexist  = 0;                  //变成1表示当前行是这回刚增进去的,所以其对应的托码整个都要增进去
                        for (int x = 0; x < ET_TM.Count; x++) //按箱码进行循环
                        {
                            CRM_BC_PMLIST cxmodel = new CRM_BC_PMLIST();
                            if (ET_TM[x].TPM != TPM_temp)                   //当托码变化时,去数据库看下这个托码是否已经存在
                            {
                                isexist        = 0;
                                cxmodel.AUFNR  = model.AUFNR;
                                cxmodel.TPM    = ET_TM[x].TPM;
                                cxmodel.PMTYPE = 1;
                                CRM_BC_PMLIST[] cxresult = crmModels.BC_PMLIST.SelectByModel(cxmodel, "", "", token);
                                if (cxresult.Length != 0 && isexist == 0)          //已经有这个托码了,就跳过
                                {
                                    continue;
                                }
                                else          //这个托码还没生成喷码
                                {
                                    isexist   = 1;
                                    model.DXM = ET_TM[x].DXM;
                                    model.TPM = ET_TM[x].TPM;

                                    model.PM     = PM;
                                    model.PMTYPE = 1;   //根据工单
                                    int i = crmModels.BC_PMLIST.Create(model, token);
                                    if (i <= 0)
                                    {
                                        return("生成失败!");
                                    }
                                }
                            }
                            else
                            {
                                if (isexist == 1)
                                {
                                    model.DXM = ET_TM[x].DXM;
                                    model.TPM = ET_TM[x].TPM;

                                    model.PM     = PM;
                                    model.PMTYPE = 1;   //根据工单
                                    int i = crmModels.BC_PMLIST.Create(model, token);
                                    if (i <= 0)
                                    {
                                        return("生成失败!");
                                    }
                                }
                                else
                                {
                                    continue;
                                }
                            }

                            TPM_temp = ET_TM[x].TPM;
                        }
                    }
                }
                else        //数据库里没有该工单的数据
                {
                    MODEL_ZBCFUN_TM_READ TMmodel = crmModels.BarCode.GET_ZBCFUN_TM_READ(model.AUFNR, "F", token);
                    if (TMmodel.ET_TM.Length == 0)
                    {
                        return("该工单没有所属箱码");
                    }

                    List <ZSL_BCT100> ET_TM = TMmodel.ET_TM.ToList();
                    //ET_TM = (from o in ET_TM orderby (o.DXM.Substring(2,o.DXM.Length-2)) select o).ToList();
                    ET_TM = ET_TM.OrderBy(u => u.TPM.Substring(2, u.TPM.Length - 2)).ThenBy(u => u.DXM.Substring(2, u.DXM.Length - 2)).ToList();

                    string PM = "";
                    if (isTuiHuo == "1")       //如果是退货的话喷码统一为ZAA
                    {
                        PM = "ZAA";
                    }
                    for (int x = 0; x < ET_TM.Count; x++)
                    {
                        model.DXM = ET_TM[x].DXM;
                        model.TPM = ET_TM[x].TPM;

                        model.PM     = PM;
                        model.PMTYPE = 1;   //根据工单
                        int i = crmModels.BC_PMLIST.Create(model, token);
                        if (i <= 0)
                        {
                            return("生成失败!");
                        }
                    }
                    //if (isTuiHuo == "0")       //不是退货的话需要生成喷码
                    //{
                    //    int error = crmModels.BC_PMLIST.UpdatePM(token);    //生成喷码
                    //    if (error != 0)
                    //    {
                    //        return "喷码生成失败,请重试";
                    //    }
                    //}
                }
            }
            catch (Exception e)
            {
                return(e.Message);
            }


            return("生成成功!");
        }
Esempio n. 21
0
        public ActionResult Basic()
        {
            token = appClass.CRM_Gettoken();

            CRM_QYJS_MENU model = new CRM_QYJS_MENU();

            model.PLOGID = 2;
            CRM_QYJS_MENU[] data = crmModels.QYJS_MENU.ReadTTbyParam(model, token);
            ViewBag.data = data;
            return(View());
        }
Esempio n. 22
0
        public ActionResult Show_Notice(int NoticeTTid)
        {
            token = appClass.CRM_Gettoken();
            CRM_MSG_NOTICETTList data = crmModels.MSG_NOTICE.ReadTTbyTTID(NoticeTTid, token);



            return(View());
        }
Esempio n. 23
0
        public ActionResult Select()
        {
            token = appclass.CRM_Gettoken();
            Session["location"] = 10;
            //return PartialView("Select");

            CRM_HG_DEPT[] DEPTdata = crmModels.HG_DEPT.Read(token);
            ViewBag.DEPTdata = DEPTdata;

            CRM_HG_DICT[] JOB       = crmModels.HG_DICT.Read(13, 0, token);
            CRM_HG_DICT[] POST      = crmModels.HG_DICT.Read(14, 0, token);
            CRM_HG_DICT[] XUELI     = crmModels.HG_DICT.Read(16, 0, token);
            CRM_HG_DICT[] STAFFTYPE = crmModels.HG_DICT.Read(33, 0, token);

            ViewBag.JOB       = JOB;
            ViewBag.POST      = POST;
            ViewBag.XUELI     = XUELI;
            ViewBag.STAFFTYPE = STAFFTYPE;



            return(View());
        }
Esempio n. 24
0
        public ActionResult CheckPoint()
        {
            Session["location"] = 206;
            token = appClass.CRM_Gettoken();
            HR_SY_DEPT_SELECT r = hrmodels.SY_DEPT.SELECT(new HR_SY_DEPT(), token);

            ViewBag.DEPList = r;
            FIVES_SY_DICT model     = new FIVES_SY_DICT();
            FIVES_SY_TYPE TYPEmodel = new FIVES_SY_TYPE();

            TYPEmodel.TYPENAME = "检查频率";
            FIVES_SY_TYPE[] TYPEDATA = fivesmodels.SY_TYPE.Read(TYPEmodel, token);
            model.TYPEID = TYPEDATA[0].TYPEID;
            FIVES_SY_DICT[] RES = fivesmodels.SY_DICT.Read(model, token);
            ViewBag.RES = RES;

            FIVES_SY_DICT cxmodel    = new FIVES_SY_DICT();
            FIVES_SY_TYPE TYPEmodel2 = new FIVES_SY_TYPE();

            TYPEmodel2.TYPENAME = "检查类型";
            FIVES_SY_TYPE[] TYPEDATA2 = fivesmodels.SY_TYPE.Read(TYPEmodel2, token);
            model.TYPEID = TYPEDATA2[0].TYPEID;
            FIVES_SY_DICT[] JCRES = fivesmodels.SY_DICT.Read(model, token);

            List <FIVES_SY_DICT> ListJcres = JCRES.ToList();

            for (int i = JCRES.Length - 1; i >= 0; i--)
            {
                if (JCRES[i].DICNAME == "抽检")
                {
                    ListJcres[i].DICID = 0;
                }
                if (JCRES[i].DICNAME == "巡检")
                {
                    ListJcres[i].DICID = 0;
                }
            }
            FIVES_SY_DICT[] JCRES_set = ListJcres.ToArray();
            ViewBag.JCRES = JCRES_set;
            return(View());
        }