Ejemplo n.º 1
0
        public void exportExcel()
        {
            try
            {
                string      record = this.Request["record"];
                pshctvalBll bll    = new pshctvalBll();

                tpshctcfg cfg = bll.GetSelectedObject <tpshctcfg>(new List <ColumnInfo>()
                {
                    new ColumnInfo()
                    {
                        ColumnName = "hccd", ColumnValue = record
                    }
                });

                tstdefcfg xdef = bll.GetSelectedObject <tstdefcfg>(new List <ColumnInfo>()
                {
                    new ColumnInfo()
                    {
                        ColumnName = "dfnm", ColumnValue = cfg.xdef
                    }
                });

                tstdefcfg ydef = bll.GetSelectedObject <tstdefcfg>(new List <ColumnInfo>()
                {
                    new ColumnInfo()
                    {
                        ColumnName = "dfnm", ColumnValue = cfg.ydef
                    }
                });

                ValueInfoBll     dd   = new ValueInfoBll();
                List <ValueInfo> lstX = typeof(ValueInfoBll).GetMethod(xdef.dasc).Invoke(dd, new object[] { }) as List <ValueInfo>;
                List <ValueInfo> lstY = typeof(ValueInfoBll).GetMethod(ydef.dasc).Invoke(dd, new object[] { }) as List <ValueInfo>;

                List <List <ColumnInfo> > lstResult = bll.GetHeadCountCfgValue(record, cfg, lstX, lstY);

                if (lstResult != null)
                {
                    UtilExcel.ExportToExcel(Response, this.GetType().Name, lstResult);
                }
            }
            catch (Exception ex)
            {
                string message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
Ejemplo n.º 2
0
        public void list()
        {
            string      record = this.Request["record"];
            pshctvalBll bll    = new pshctvalBll();

            tpshctcfg cfg = bll.GetSelectedObject <tpshctcfg>(new List <ColumnInfo>()
            {
                new ColumnInfo()
                {
                    ColumnName = "hccd", ColumnValue = record
                }
            });

            tstdefcfg xdef = bll.GetSelectedObject <tstdefcfg>(new List <ColumnInfo>()
            {
                new ColumnInfo()
                {
                    ColumnName = "dfnm", ColumnValue = cfg.xdef
                }
            });

            tstdefcfg ydef = bll.GetSelectedObject <tstdefcfg>(new List <ColumnInfo>()
            {
                new ColumnInfo()
                {
                    ColumnName = "dfnm", ColumnValue = cfg.ydef
                }
            });

            ValueInfoBll     dd   = new ValueInfoBll();
            List <ValueInfo> lstX = typeof(ValueInfoBll).GetMethod(xdef.dasc).Invoke(dd, new object[] { }) as List <ValueInfo>;
            List <ValueInfo> lstY = typeof(ValueInfoBll).GetMethod(ydef.dasc).Invoke(dd, new object[] { }) as List <ValueInfo>;

            List <List <ColumnInfo> > lstResult = bll.GetHeadCountCfgValue(record, cfg, lstX, lstY);
            int total = lstResult.Count;

            string json = ConvertToJson(lstResult);

            Response.Write("{results:" + total + ",rows:" + json + "}");

            //ViewData["hctconfig"] = responseJson(lstResult,lstX,lstY);
        }