Example #1
0
        public void CalcLeaveTime()
        {
            string message = "{}";

            try
            {
                string    record = this.Request["record"];
                Hashtable ht     = JavaScriptConvert.DeserializeObject <Hashtable>(record);

                tlvleaapp obj = new tlvleaapp();
                obj.emno = ht["emno"].ToString();
                obj.frtm = Convert.ToDateTime(ht["fromdate"].ToString());
                obj.totm = Convert.ToDateTime(ht["todate"].ToString());

                lvleaappBll bll  = new lvleaappBll();
                string      json = bll.CalcLeaveTime(obj);

                message = "{status:'success'," + json + "}";
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_EditBad, ex, true) + "'}";
            }
            Response.Write(message);
        }
Example #2
0
        public void getNew()
        {
            string message = "{}";

            try
            {
                string    record = this.Request["record"];
                Hashtable ht     = JavaScriptConvert.DeserializeObject <Hashtable>(record);

                List <ColumnInfo> parameters = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["keycolumns"].ToString());

                List <tpsempchg> listDtl = JavaScriptConvert.DeserializeObject <List <tpsempchg> >(ht["dtlparams"].ToString());

                psempchgBll bll = new psempchgBll();

                bll.InsertEmpChange(listDtl);

                message = "{status:'success',msg:'" + HRMSRes.Public_Message_EditWell + "'}";
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_EditBad, ex, true) + "'}";
            }
            Response.Write(message);
        }
Example #3
0
        public void listdetails()
        {
            try
            {
                string record = this.Request["record"];

                Hashtable         ht   = JavaScriptConvert.DeserializeObject <Hashtable>(record);
                List <ColumnInfo> list = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["params"].ToString());

                int start = Convert.ToInt32(this.Request["start"]);
                int limit = Convert.ToInt32(this.Request["limit"]);

                praccalcBll bll = new praccalcBll();

                int total = 0;

                List <object> dataList = bll.GetDetails(list, true, start, start + limit, ref total);
                string        json     = JavaScriptConvert.SerializeObject(dataList);
                Response.Write("{results:" + total + ",rows:" + json + "}");
            }
            catch (Exception ex)
            {
                string message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
Example #4
0
        public void Edit()
        {
            string message = "{}";

            try
            {
                string    record = this.Request["record"];
                Hashtable ht     = JavaScriptConvert.DeserializeObject <Hashtable>(record);

                List <ColumnInfo> parameters = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["keycolumns"].ToString());

                tlvleaapp obj = JavaScriptConvert.DeserializeObject <tlvleaapp>(ht["params"].ToString());

                //new BaseBll().DoInsert<T>(obj);

                lvleaappBll bll = new lvleaappBll();
                bll.UpdateLeaveApplication(obj);

                message = "{status:'success',msg:'" + HRMSRes.Public_Message_EditWell + "'}";
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_EditBad, ex, true) + "'}";
            }
            Response.Write(message);
        }
Example #5
0
        public void getEmpLeaveSettings()
        {
            string message;

            try
            {
                string record = this.Request["record"];

                Hashtable ht = JavaScriptConvert.DeserializeObject <Hashtable>(record);

                lvleaappBll bll = new lvleaappBll();

                LvSettingInfo lstSettings = bll.GetEmpLeaveSettings(ht["emno"].ToString(), ht["ltcd"].ToString(), Convert.ToDateTime(ht["fromdate"].ToString()));

                string json = JavaScriptConvert.SerializeObject(lstSettings);

                message = "{status:'success',msg:'" + json + "'}";

                Response.Write(message);
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
Example #6
0
        public void importExcel()
        {
            string message = "{}";

            try
            {
                table_name = this.Request["tableName"];
                string cols = this.Request["cols"];

                HttpPostedFileBase file = null;
                for (int i = 0; i < Request.Files.Count; i++)
                {
                    file = Request.Files[i];
                }

                if (file != null)
                {
                    string fileFullName  = file.FileName;
                    string fileExtension = Path.GetExtension(fileFullName).ToLower();

                    if (fileExtension.ToLower().Equals(".xls"))
                    {
                        string tempPath          = Path.GetTempPath();
                        string fileName          = Path.GetFileName(fileFullName);
                        string savedFileFullName = tempPath + fileName;
                        file.SaveAs(savedFileFullName);

                        MasterDataBll bll             = new MasterDataBll(table_name);
                        string        excelDataSource = ConfigReader.getDBConnectionString_Excel().Replace("File.xls", savedFileFullName);

                        List <ColumnInfo> list = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(cols);
                        bll.InsertFromExcel(table_name, excelDataSource, list);

                        message = "{success:true, status:'success',msg:'" + HRMSRes.Public_Message_ImportWell + "'}";
                        FileInfo fileInfo = new FileInfo(savedFileFullName);
                        fileInfo.Delete();
                    }
                    else
                    {
                        throw new Exception(HRMSRes.Public_Message_FileNotEmpty);
                    }
                }
                else
                {
                    throw new Exception();
                }
            }
            catch (Exception ex)
            {
                message = "{errors:'',status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_ImportBad, ex, true) + ")'}";
            }
            Response.Output.Write(message);
        }
Example #7
0
        public void exportExcel()
        {
            try
            {
                string record = this.Request["record"];

                Hashtable ht = JavaScriptConvert.DeserializeObject <Hashtable>(record);
                //List<ColumnInfo> records = JavaScriptConvert.DeserializeObject<List<ColumnInfo>>(ht["params"].ToString());
                List <ColumnInfo> headers = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["headers"].ToString());

                List <ColumnInfo> atdtParameters     = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["atdtparams"].ToString());
                List <ColumnInfo> personalParameters = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["personalparams"].ToString());

                string scope = ht["scope"].ToString();

                List <ColumnInfo> fullParameters = new List <ColumnInfo>();

                for (int i = 0; i < personalParameters.Count; i++)
                {
                    fullParameters.Add(personalParameters[i]);
                }

                for (int i = 0; i < atdtParameters.Count; i++)
                {
                    fullParameters.Add(atdtParameters[i]);
                }

                fullParameters.Add(new ColumnInfo()
                {
                    ColumnName = "atst", ColumnValue = (scope == "All" ? "" : "1")
                });                                                                                                      //1: abnormal

                atanarstBll bll = new atanarstBll();

                int total = 0;


                List <object> obj = bll.GetAnalyzeResult(fullParameters, false, 0, 0, ref total);


                if ((obj != null) && (total > 0))
                {
                    List <object> finalObj = BuildAnonymousObject(obj).Cast <object>().ToList();
                    UtilExcel.ExportToExcel(finalObj[0].GetType(), Response, this.GetType().Name.GetPageName(), headers, finalObj);
                }
            }
            catch (Exception ex)
            {
                string message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
Example #8
0
 public void Help()
 {
     try
     {
         string tabId    = this.Request["record"];
         string helpFile = AppDomain.CurrentDomain.BaseDirectory + @"\Help\Help_" + tabId + ".xml";
         this.Response.Write(getHelpContent(helpFile));
     }
     catch (Exception ex)
     {
         this.Response.Write(ExceptionPaser.Parse(ex, true));
     }
 }
Example #9
0
        //public void delete()
        //{
        //    string msg = string.Empty;
        //    try
        //    {
        //        PeriodBll periodBll = new PeriodBll();
        //        string year = Request.Form["Year"];
        //        string period = Request.Form["Period"];
        //        Exception_ErrorMessage error = periodBll.DeletePeriod(year, period);
        //        if (error == Exception_ErrorMessage.NoError)
        //        {
        //            msg = "{status:'success',msg:'" + HRMSRes.Public_Message_DeleteWell + "'}";
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        msg = "{status:'failure',msg:'" + HRMSRes.Public_Message_DeleteBad + "'}";
        //    }
        //    Response.Output.Write(msg);
        //}

        public void list()
        {
            string message = string.Empty;

            try
            {
                string record   = this.Request["record"];
                string startStr = this.Request["start"];
                string limitStr = this.Request["limit"];

                if ((record == null) || (record.Length < 1))
                {
                    record = "{\"year\":\"" + UtilDatetime.FormatDate3(DateTime.Now).Substring(0, 4) + "\"}";
                }
                Hashtable ht    = JavaScriptConvert.DeserializeObject <Hashtable>(record);
                int       start = 0;
                if (startStr != null)
                {
                    start = Convert.ToInt32(startStr);
                }

                int limit = 0;
                if (limitStr != null)
                {
                    limit = Convert.ToInt32(limitStr);
                }

                stperiodBll bll = new stperiodBll();

                List <ColumnInfo> parameters = new List <ColumnInfo>()
                {
                    new ColumnInfo()
                    {
                        ColumnName = "year", ColumnValue = ht["year"].ToString()
                    }
                };

                int total = 0;
                List <tstperiod> periodList = bll.GetSelectedRecords <tstperiod>(parameters, true, start, start + limit, ref total);

                string json = JavaScriptConvert.SerializeObject(periodList);
                json = "{results:" + total + ",rows:" + json + "}";
                Response.Write(json);
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
Example #10
0
        public void listAnalResult()
        {
            try
            {
                string    record = this.Request["record"];
                Hashtable ht     = JavaScriptConvert.DeserializeObject <Hashtable>(record);

                List <ColumnInfo> atdtParameters     = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["atdateparams"].ToString());
                List <ColumnInfo> personalParameters = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["personalparams"].ToString());

                string scope = ht["scope"].ToString();

                int start = Convert.ToInt32(this.Request["start"]);
                int limit = Convert.ToInt32(this.Request["limit"]);

                //list(atdtParameters, personalParameters, start, limit, scope);

                List <ColumnInfo> fullParameters = new List <ColumnInfo>();

                for (int i = 0; i < personalParameters.Count; i++)
                {
                    fullParameters.Add(personalParameters[i]);
                }

                for (int i = 0; i < atdtParameters.Count; i++)
                {
                    fullParameters.Add(atdtParameters[i]);
                }

                fullParameters.Add(new ColumnInfo()
                {
                    ColumnName = "atst", ColumnValue = (scope == "All" ? "" : "1")
                });                                                                                                      //1: abnormal

                atanarstBll bll = new atanarstBll();

                int total = 0;


                List <object> dataList = bll.GetAnalyzeResult(fullParameters, true, start, start + limit, ref total);
                string        json     = JavaScriptConvert.SerializeObject(dataList);

                Response.Write("{results:" + total + ",rows:" + json + "}");
            }
            catch (Exception ex)
            {
                string message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
Example #11
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);
            }
        }
Example #12
0
        public void showContent()
        {
            string message = string.Empty;

            try
            {
                string fileName = this.Request["fileName"];
                if (fileName != null && !fileName.Equals(string.Empty))
                {
                    HttpContext.Session["traceJson"] = null;
                }
                object obj = HttpContext.Session["traceJson"];
                List <Dictionary <string, string> > list = null;
                if (obj == null)
                {
                    if (fileName.StartsWith("SP_"))
                    {
                        list = this.readFromDatabase(fileName);
                    }
                    else
                    {
                        list = this.readFromFile(fileName);
                    }
                }
                else
                {
                    list = obj as List <Dictionary <string, string> >;
                }
                int start = 0;
                int limit = list.Count;

                string strStart = this.Request["start"];
                string strLimit = this.Request["limit"];
                if (strStart != null)
                {
                    start = Convert.ToInt16(strStart);
                    limit = Convert.ToInt16(strLimit);
                }

                List <Dictionary <string, string> > pagingList = list.GetRange(start, Math.Min(limit, list.Count - start));
                message = "{results:" + list.Count + ",rows:" + JavaScriptConvert.SerializeObject(pagingList) + "}";
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
            }
            Response.Output.Write(message);
        }
Example #13
0
        public void getFileList()
        {
            string message = "{}";

            try
            {
                string fileName = this.Request["fileName"];
                if (fileName != null && !fileName.Equals(string.Empty))
                {
                    HttpContext.Session["traceJson"] = null;
                }
                object obj = HttpContext.Session["traceJson"];
                List <Dictionary <string, string> > list = null;
                if (obj == null)
                {
                    list = UtilFile.GetFiles("");
                    //get file name from database,for stored procedure trace
                    //DataSet dsTraceNames = new tracerBll().GetTraceName();
                    //list.AddRange(this.convertDataSet(dsTraceNames));
                    HttpContext.Session["traceJson"] = list;
                }
                else
                {
                    list = obj as List <Dictionary <string, string> >;
                }
                int start = 0;
                int limit = list.Count;

                string strStart = this.Request["start"];
                string strLimit = this.Request["limit"];
                if (strStart != null)
                {
                    start = Convert.ToInt16(strStart);
                    limit = Convert.ToInt16(strLimit);
                }

                List <Dictionary <string, string> > pagingList = list.GetRange(start, Math.Min(limit, list.Count - start));
                message = "{results:" + list.Count + ",rows:" + JavaScriptConvert.SerializeObject(pagingList) + "}";
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
            }
            Response.Output.Write(message);
        }
Example #14
0
        public void search()
        {
            try
            {
                string record = this.Request["record"];
                string mode   = this.Request["mode"];

                stsearchBll           bll       = new stsearchBll();
                List <StSearchResult> lstResult = bll.Search(record, mode);
                string json = JavaScriptConvert.SerializeObject(lstResult);
                Response.Write("{results:" + lstResult.Count + ",rows:" + json + "}");
            }
            catch (Exception ex)
            {
                string message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
Example #15
0
        public void confirmRecord()
        {
            try
            {
                string record = this.Request["record"];

                Hashtable ht = JavaScriptConvert.DeserializeObject <Hashtable>(record);

                strecstsBll bll = new strecstsBll();
                bll.ConfirmRecord(ht["rfid"].ToString());

                Response.Write("{status:'success',msg:'Confirm successfully.'}");
            }
            catch (Exception ex)
            {
                string message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
Example #16
0
        public void updateNote()
        {
            try
            {
                string record = this.Request["record"];

                Hashtable ht = JavaScriptConvert.DeserializeObject <Hashtable>(record);

                strecnotBll bll = new strecnotBll();
                bll.UpdateNote(ht["rfid"].ToString(), Function.GetCurrentUser(), ht["note"].ToString());

                Response.Write("{status:'success',msg:'Update note success.'}");
            }
            catch (Exception ex)
            {
                string message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
Example #17
0
        public void getEdit()
        {
            string message = "{}";

            try
            {
                string    record = this.Request["record"];
                tpsempchg obj    = JavaScriptConvert.DeserializeObject <tpsempchg>(record);

                psempchgBll bll = new psempchgBll();
                bll.UpdateEmpChange(obj);
                message = "{status:'success',msg:'" + HRMSRes.Public_Message_EditWell + "'}";
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_EditBad, ex, true) + "'}";
            }
            Response.Write(message);
        }
Example #18
0
        public void Delete()
        {
            string message = "{}";

            try
            {
                string record = this.Request["record"];

                pshctvalBll bll = new pshctvalBll();
                bll.Delete(record);

                message = "{status:'success',msg:'" + HRMSRes.Public_Message_DeleteWell + "'}";
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_DeleteBad, ex, true) + "'}";
            }
            Response.Write(message);
        }
Example #19
0
        public void changePassword()
        {
            try
            {
                string record = this.Request["record"];

                Hashtable ht = JavaScriptConvert.DeserializeObject <Hashtable>(record);

                stusrinfBll bll  = new stusrinfBll();
                string      note = bll.ChangeUserPassword(Function.GetCurrentUser(), ht["opwd"].ToString(), ht["npwd"].ToString(), ConfigReader.getAppName());

                Response.Write("{status:'success',msg:'" + note.EscapeHtml() + "'}");
            }
            catch (Exception ex)
            {
                string message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
Example #20
0
        public void getUserInfo()
        {
            try
            {
                string record = this.Request["record"];

                Hashtable ht = JavaScriptConvert.DeserializeObject <Hashtable>(record);

                stusrinfBll bll = new stusrinfBll();
                string      msg = bll.GetUserInformation(Function.GetCurrentUser(), ConfigReader.getAppName());

                Response.Write(msg);
            }
            catch (Exception ex)
            {
                string message = ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true);
                Response.Output.Write(message);
            }
        }
Example #21
0
        public void getDelete()
        {
            string message = "{}";

            try
            {
                string            record     = this.Request["record"];
                Hashtable         ht         = JavaScriptConvert.DeserializeObject <Hashtable>(record);
                List <ColumnInfo> parameters = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["params"].ToString());

                new prprirstBll().DeletePriRuleSet(parameters);
                message = "{status:'success',msg:'" + HRMSRes.Public_Message_DeleteWell + "'}";
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_DeleteBad, ex, true) + "'}";
            }
            Response.Write(message);
        }
Example #22
0
        public virtual void getNew <T>() where T : class
        {
            string message = "{}";

            try
            {
                string record = this.Request["record"];
                T      obj    = JavaScriptConvert.DeserializeObject <T>(record);

                new BaseBll().DoInsert <T>(obj);

                message = "{status:'success',msg:'" + HRMSRes.Public_Message_AddWell + "'}";
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_AddBad, ex, true) + "'}";
            }
            Response.Write(message);
        }
Example #23
0
        public void getDelete()
        {
            string message = "{}";

            try
            {
                string            record     = this.Request["record"];
                Hashtable         ht         = JavaScriptConvert.DeserializeObject <Hashtable>(record);
                List <ColumnInfo> parameters = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["params"].ToString());

                new atdatmnuBll().DeleteDataManu(parameters);
                message = "{status:'success',msg:'" + HRMSRes.Public_Message_DeleteWell + ".You should do attendance analysis again.'}";
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_DeleteBad, ex, true) + "'}";
            }
            Response.Write(message);
        }
Example #24
0
        public void handleMesssage()
        {
            try
            {
                string record = this.Request["record"];

                Hashtable ht = JavaScriptConvert.DeserializeObject <Hashtable>(record);

                staldlybBll bll = new staldlybBll();
                bll.HandleMesssage(ht["adid"].ToString());

                Response.Write("{status:'success',msg:'Message handled success.'}");
            }
            catch (Exception ex)
            {
                string message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
Example #25
0
        public void exportExcel()
        {
            string message = string.Empty;

            try
            {
                string record = this.Request["record"];
                string header = this.Request["header"];

                if ((record == null) || (record.Length < 1))
                {
                    record = "{\"year\":\"" + UtilDatetime.FormatDate3(DateTime.Now).Substring(0, 4) + "\"}";
                }

                if (header == null || header.Equals(string.Empty))
                {
                    return;
                }
                Hashtable         ht      = JavaScriptConvert.DeserializeObject <Hashtable>(record);
                List <ColumnInfo> headers = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(header);
                stperiodBll       bll     = new stperiodBll();

                List <ColumnInfo> parameters = new List <ColumnInfo>()
                {
                    new ColumnInfo()
                    {
                        ColumnName = "year", ColumnValue = ht["year"].ToString()
                    }
                };

                List <tstperiod> yearList = bll.GetSelectedRecords <tstperiod>(parameters);
                if (yearList != null)
                {
                    UtilExcel.ExportToExcel(Response, this.GetType().Name.GetPageName(), headers, yearList);
                }
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_ExportExcelFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
Example #26
0
        public void list()
        {
            try
            {
                string startStr = this.Request["start"];
                int    start    = 0;
                if (startStr != null)
                {
                    start = Convert.ToInt32(startStr);
                }

                string limitStr = this.Request["limit"];
                int    limit    = 0;
                if (limitStr != null)
                {
                    limit = Convert.ToInt32(limitStr);
                }

                table_name = this.Request["tableName"];
                string record = this.Request["record"];
                int    total  = 0;

                MasterDataBll bll = new MasterDataBll();

                object            dataList   = null;
                List <ColumnInfo> parameters = new List <ColumnInfo>();
                if (record != null)
                {
                    parameters = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(record);
                }

                dataList = bll.GetSelectedRecords(table_name, parameters, true, start, start + limit, ref total);

                string json = JavaScriptConvert.SerializeObject(dataList);
                Response.Write("{results:" + total + ",rows:" + json + "}");
            }
            catch (Exception ex)
            {
                string message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
Example #27
0
        public void GetNewSMID()
        {
            string message = "{}";

            try
            {
                string record = this.Request["record"];

                stpubmsgBll bll = new stpubmsgBll();

                string msg = bll.GetNewSMID();

                message = "{status:'success',msg:'" + msg + "'}";
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_DeleteBad, ex, true) + "'}";
            }
            Response.Write(message);
        }
Example #28
0
        public void getNew()
        {
            string message = "{}";

            try
            {
                string    record = this.Request["record"];
                tpsemplym obj    = JavaScriptConvert.DeserializeObject <tpsemplym>(record);

                psemplymBll bll = new psemplymBll();
                bll.InsertEmployment(obj);

                message = "{status:'success',msg:'" + HRMSRes.Public_Message_AddWell + "'}";
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_AddBad, ex, true) + "'}";
            }
            Response.Write(message);
        }
Example #29
0
        public override void getEdit <T>()
        {
            string message = "{}";

            try
            {
                string    record = this.Request["record"];
                Hashtable ht     = JavaScriptConvert.DeserializeObject <Hashtable>(record);

                List <ColumnInfo> parameters = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["keycolumns"].ToString());
                T obj = JavaScriptConvert.DeserializeObject <T>(ht["params"].ToString());

                new BaseBll().DoUpdate <T>(obj, parameters);
                message = "{status:'success',msg:'" + HRMSRes.Public_Message_EditWell + "'}";
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_EditBad, ex, true) + "'}";
            }
            Response.Write(message);
        }
Example #30
0
        public void GetAutoStaffId()
        {
            string message = string.Empty;

            try
            {
                string      emno = string.Empty;
                string      sfid = string.Empty;
                pspersonBll bll  = new pspersonBll();

                bll.GetAutoStaffId(ref emno, ref sfid);

                message = "{status:'success',emno:'" + emno + "',sfid:'" + sfid + "'}";
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(ex.Message, ex, true) + "'}";
            }

            Response.Output.Write(message);
        }