Ejemplo n.º 1
0
        public ActionResult CHECK_INFO()
        {
            token = appClass.CRM_Gettoken();
            Session["location"] = 209;
            Sonluk.UI.Model.S5.SY_CHECKPOINTService.FIVES_SY_CHECKPOINT   checkpointModel = new Sonluk.UI.Model.S5.SY_CHECKPOINTService.FIVES_SY_CHECKPOINT();
            Sonluk.UI.Model.S5.SY_CHECKPOINTService.FIVES_SY_CHECKPOINT[] checkpointRes   = fivesmodels.SY_CHECKPOINT.Read(checkpointModel, token);
            ViewBag.CheckPointArr = checkpointRes;
            HR_SY_DEPT        deptModel = new HR_SY_DEPT();
            HR_SY_DEPT_SELECT deptRes   = hrmodels.SY_DEPT.SELECT(deptModel, token);

            ViewBag.DeptArr = deptRes.HR_SY_DEPT_LIST;
            FIVES_SY_DICT JCLXmodel = new FIVES_SY_DICT();

            JCLXmodel.TYPEID = 2;
            FIVES_SY_DICT[] JCLXRes = fivesmodels.SY_DICT.Read(JCLXmodel, token);
            ViewBag.JCLXArr = JCLXRes;
            string              datastring = "{\"DEPID\":\"0\",\"STAFFNAME\":\"\",\"STAFFNO\":\"\"}";
            MES_SY_STAFF        model      = Newtonsoft.Json.JsonConvert.DeserializeObject <MES_SY_STAFF>(datastring);
            MES_SY_STAFF_SELECT rst_MES_SY_STAFF_SELECT = mesModels.SY_STAFF.SELECT(model, token);

            ViewBag.STAFFArr = rst_MES_SY_STAFF_SELECT.MES_SY_STAFF;


            JCLXmodel.TYPEID = 1;

            ViewBag.DFArr = fivesmodels.SY_DICT.Read(JCLXmodel, token);
            return(View());
        }
Ejemplo n.º 2
0
        public string SELECT_DEPT_RYCOUNT(int DEPTID)
        {
            string            token = AppClass.GetSession("token").ToString();
            HR_SY_DEPT_SELECT rst   = hrmodels.SY_DEPT.SELECT_RYCOUNT(DEPTID, token);

            return(Newtonsoft.Json.JsonConvert.SerializeObject(rst));
        }
Ejemplo n.º 3
0
        public ActionResult STAFF_DEP_ACCESS()
        {
            token = appClass.CRM_Gettoken();
            Session["location"] = 216;
            MODEK_StaffManage model = new MODEK_StaffManage();


            HR_SY_DEPT_SELECT res = hrmodels.SY_DEPT.SELECT(new HR_SY_DEPT(), token);

            if (res.MES_RETURN.TYPE == "S")
            {
            }
            ViewData.Model = 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);
            cxmodel.TYPEID = TYPEDATA2[0].TYPEID;
            FIVES_SY_DICT[]      JCRES  = fivesmodels.SY_DICT.Read(cxmodel, token);
            List <FIVES_SY_DICT> JCLIST = JCRES.ToList();


            FIVES_SY_DICT CXMODEL2 = new FIVES_SY_DICT();

            CXMODEL2.DICNAME = "通知";
            FIVES_SY_DICT[] JCRES2 = fivesmodels.SY_DICT.Read(CXMODEL2, token);
            JCLIST.Add(JCRES2[0]);

            FIVES_SY_DICT[] JCRESULT = JCLIST.ToArray();
            ViewBag.JCRESULT = JCRESULT;

            return(View());
        }
Ejemplo n.º 4
0
        public string DEPT_SELECT(string datastring)
        {
            string            token            = AppClass.GetSession("token").ToString();
            HR_SY_DEPT        model_HR_SY_DEPT = new HR_SY_DEPT();
            HR_SY_DEPT_SELECT rst = hrmodels.SY_DEPT.SELECT(model_HR_SY_DEPT, token);

            return(Newtonsoft.Json.JsonConvert.SerializeObject(rst));
        }
Ejemplo n.º 5
0
        public string EXPOST_DEPT()
        {
            string            token            = AppClass.GetSession("token").ToString();
            HR_SY_DEPT        model_HR_SY_DEPT = new HR_SY_DEPT();
            HR_SY_DEPT_SELECT model_rst        = hrmodels.SY_DEPT.SELECT(model_HR_SY_DEPT, token);
            MES_RETURN_UI     rst = new MES_RETURN_UI();

            try
            {
                FileStream             file     = new FileStream(Server.MapPath("~") + @"/Areas/HR/ExportFile/部门导出.xlsx", FileMode.Open, FileAccess.Read);
                IWorkbook              workbook = new XSSFWorkbook(file);
                ISheet                 sheet    = workbook.GetSheetAt(0);
                int                    rowcount = 1;
                List <HR_SY_DEPT_LIST> alldata  = new List <HR_SY_DEPT_LIST>();
                for (int i = 0; i < model_rst.HR_SY_DEPT_LIST.Length; i++)
                {
                    if (model_rst.HR_SY_DEPT_LIST[i].FID != 0)
                    {
                        alldata.Add(model_rst.HR_SY_DEPT_LIST[i]);
                    }
                }
                for (int i = 0; i < alldata.Count; i++)
                {
                    int  cellIndex = 0;
                    IRow row       = sheet.CreateRow(rowcount++);
                    row.CreateCell(cellIndex++).SetCellValue(Convert.ToString(alldata[i].GS));
                    row.CreateCell(cellIndex++).SetCellValue(Convert.ToString(alldata[i].GSNAME));
                    row.CreateCell(cellIndex++).SetCellValue(Convert.ToString(alldata[i].DEPTNAME));
                    row.CreateCell(cellIndex++).SetCellValue(Convert.ToString(alldata[i].DEPTBZRS));
                    row.CreateCell(cellIndex++).SetCellValue(Convert.ToString(alldata[i].DEPTBMLBNAME));
                    row.CreateCell(cellIndex++).SetCellValue(Convert.ToString(alldata[i].DEPTFZRNAME));
                    row.CreateCell(cellIndex++).SetCellValue(Convert.ToString(alldata[i].DEPTNO));
                    row.CreateCell(cellIndex++).SetCellValue(Convert.ToString(alldata[i].DEPTCBZX));
                    if (alldata[i].ISACTION == 1)
                    {
                        row.CreateCell(cellIndex++).SetCellValue("启用");
                    }
                    else
                    {
                        row.CreateCell(cellIndex++).SetCellValue("关闭");
                    }
                    row.CreateCell(cellIndex++).SetCellValue(Convert.ToString(alldata[i].FDEPTNAME));
                }
                string     now   = DateTime.Now.ToString("yyyyMMddHHmmss.fff");
                FileStream file1 = new FileStream(string.Format(@"{0}/Areas/HR/ExportFile/{1}.xlsx", Server.MapPath("~"), now), FileMode.Create);
                workbook.Write(file1);
                file1.Close();
                rst.TYPE    = "S";
                rst.MESSAGE = now;
            }
            catch
            {
                rst.TYPE    = "E";
                rst.MESSAGE = "生成文件失败!";
            }
            return(Newtonsoft.Json.JsonConvert.SerializeObject(rst));
        }
Ejemplo n.º 6
0
        public string DEPT_SELECT()
        {
            token = appClass.CRM_Gettoken();
            //HR_SY_DEPT model = Newtonsoft.Json.JsonConvert.DeserializeObject<HR_SY_DEPT>(data);
            HR_SY_DEPT        model = new HR_SY_DEPT();
            HR_SY_DEPT_SELECT res   = hrmodels.SY_DEPT.SELECT(model, token);

            return(Newtonsoft.Json.JsonConvert.SerializeObject(res));
        }
Ejemplo n.º 7
0
        public string SELECT_BY_ROLE_LD(string datastring)
        {
            string     token            = AppClass.GetSession("token").ToString();
            int        STAFFID          = Convert.ToInt32(AppClass.GetSession("STAFFID"));
            HR_SY_DEPT model_HR_SY_DEPT = Newtonsoft.Json.JsonConvert.DeserializeObject <HR_SY_DEPT>(datastring);

            model_HR_SY_DEPT.STAFFID = STAFFID;
            HR_SY_DEPT_SELECT rst = hrmodels.SY_DEPT.SELECT_BY_ROLE_LD(model_HR_SY_DEPT, token);

            return(Newtonsoft.Json.JsonConvert.SerializeObject(rst));
        }
Ejemplo n.º 8
0
        public string EXPOST_BZKHREPORT(string datastring, int LB)
        {
            MES_RETURN_UI rst              = new MES_RETURN_UI();
            string        token            = AppClass.GetSession("token").ToString();
            int           STAFFID          = Convert.ToInt32(AppClass.GetSession("STAFFID"));
            HR_SY_DEPT    model_HR_SY_DEPT = new HR_SY_DEPT();

            model_HR_SY_DEPT.STAFFID = STAFFID;
            HR_SY_DEPT_SELECT result = hrmodels.SY_DEPT.SELECT_LB(model_HR_SY_DEPT, LB, token);

            if (result.MES_RETURN.TYPE == "E")
            {
                return(Newtonsoft.Json.JsonConvert.SerializeObject(result.MES_RETURN));
            }
            try
            {
                FileStream file      = new FileStream(Server.MapPath("~") + @"/Areas/HR/ExportFile/导出模版.xlsx", FileMode.Open, FileAccess.Read);
                IWorkbook  workbook  = new XSSFWorkbook(file);
                ISheet     sheet     = workbook.GetSheetAt(0);
                int        rowcount  = 0;
                string     tt        = "公司,部门,编制人数,";
                string[]   ttlist    = tt.Split(',');
                IRow       rowtt     = sheet.CreateRow(rowcount++);
                int        cellIndex = 0;
                for (int a = 0; a < ttlist.Length; a++)
                {
                    rowtt.CreateCell(cellIndex++).SetCellValue(ttlist[a]);
                }
                DataTable dtinfo = result.DATALIST;
                for (int i = 0; i < dtinfo.Rows.Count; i++)
                {
                    cellIndex = 0;
                    IRow row = sheet.CreateRow(rowcount++);
                    row.CreateCell(cellIndex++).SetCellValue(dtinfo.Rows[i]["GSNAME"].ToString());
                    row.CreateCell(cellIndex++).SetCellValue(dtinfo.Rows[i]["DEPTNAME"].ToString());
                    row.CreateCell(cellIndex++).SetCellValue(Convert.ToInt32(dtinfo.Rows[i]["DEPTBZRS"].ToString()));
                    row.CreateCell(cellIndex++).SetCellValue(Convert.ToInt32(dtinfo.Rows[i]["GSBMRYCOUNT"].ToString()));
                }
                string     now   = DateTime.Now.ToString("yyyyMMddHHmmss.fff");
                FileStream file1 = new FileStream(string.Format(@"{0}/Areas/HR/ExportFile/{1}.xlsx", Server.MapPath("~"), now), FileMode.Create);
                workbook.Write(file1);
                file1.Close();
                rst.TYPE    = "S";
                rst.MESSAGE = now;
            }
            catch
            {
                rst.TYPE    = "E";
                rst.MESSAGE = "生成文件失败!";
            }
            return(Newtonsoft.Json.JsonConvert.SerializeObject(rst));
        }
Ejemplo n.º 9
0
        public ActionResult STAFF_DEP()
        {
            token = appClass.CRM_Gettoken();
            Session["location"] = 208;
            MODEK_StaffManage model = new MODEK_StaffManage();

            CRM_HG_DEPT[]     rst_CRM_HG_DEPT = crmModels.HG_DEPT.Read(token);
            HR_SY_DEPT_SELECT res             = hrmodels.SY_DEPT.SELECT(new HR_SY_DEPT(), token);

            AppClass.SetSession("five_dep", res);
            model.CRM_HG_DEPT = rst_CRM_HG_DEPT;
            ViewData.Model    = model;
            return(View());
        }
Ejemplo n.º 10
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());
        }
Ejemplo n.º 11
0
        public string SY_DEPT_SELECT()
        {
            HR_SY_DEPT_SELECT res = (HR_SY_DEPT_SELECT)AppClass.GetSession("five_dep");

            return(Newtonsoft.Json.JsonConvert.SerializeObject(res));
        }