예제 #1
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());
                List <trcaplfml>  lstFamily     = JavaScriptConvert.DeserializeObject <List <trcaplfml> >(ht["family"].ToString());
                List <trcapledu>  lstEducation  = JavaScriptConvert.DeserializeObject <List <trcapledu> >(ht["education"].ToString());
                List <trcaplexp>  lstExperience = JavaScriptConvert.DeserializeObject <List <trcaplexp> >(ht["experience"].ToString());
                List <trcapllan>  lstLanguage   = JavaScriptConvert.DeserializeObject <List <trcapllan> >(ht["language"].ToString());
                List <trcaplref>  lstReference  = JavaScriptConvert.DeserializeObject <List <trcaplref> >(ht["reference"].ToString());

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

                rcaplinfBll bll = new rcaplinfBll();

                bll.UpdateApplicant(obj, lstFamily, lstEducation, lstExperience, lstLanguage, lstReference);

                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);
        }
예제 #2
0
        public void applyto()
        {
            string message;

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

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

                List <string> empParameters = JavaScriptConvert.DeserializeObject <List <string> >(ht["empparams"].ToString());
                tlvdfbyem     obj           = JavaScriptConvert.DeserializeObject <tlvdfbyem>(ht["objparams"].ToString());

                lvdfbyempBll bll = new lvdfbyempBll();

                bll.ApplyTo(empParameters, obj);

                message = "{status:'success',msg:'" + HRMSRes.Public_Message_AddWell + "'}";

                Response.Write(message);
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
예제 #3
0
        public void listBoardMessage()
        {
            try
            {
                string record = this.Request["record"];

                //Hashtable ht = JavaScriptConvert.DeserializeObject<Hashtable>(record);
                //List<ColumnInfo> list = JavaScriptConvert.DeserializeObject<List<ColumnInfo>>(ht["params"].ToString());
                List <ColumnInfo> list = new List <ColumnInfo>()
                {
                    new ColumnInfo()
                    {
                        ColumnName = "reci", ColumnValue = Function.GetCurrentStaff()
                    }
                };

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

                int total = 0;

                staldlybBll bll = new staldlybBll();

                List <tstaldlyb> dataList = bll.GetSelectedRecords <tstaldlyb>(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);
            }
        }
예제 #4
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());

                //tprpubrst obj = JavaScriptConvert.DeserializeObject<tprpubrst>(ht["params"].ToString());
                List <tprprirst> listDtl = JavaScriptConvert.DeserializeObject <List <tprprirst> >(ht["dtlparams"].ToString());

                prprirstBll bll = new prprirstBll();

                bll.InsertPriRuleSet(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);
        }
예제 #5
0
        public void getEdit()
        {
            string message = "{}";

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

                tpsemplym obj = JavaScriptConvert.DeserializeObject <tpsemplym>(record);

                new psemplymBll().UpdateEmployment(obj, new List <ColumnInfo> {
                    new ColumnInfo()
                    {
                        ColumnName = "emno", ColumnValue = obj.emno
                    }
                }, action);
                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);
        }
예제 #6
0
        public void carryforward()
        {
            string            message = "{}";
            List <ColumnInfo> carryforwardParameters = null;
            List <ColumnInfo> personalParameters     = null;

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

                try
                {
                    carryforwardParameters = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["carryforwardparams"].ToString());
                    personalParameters     = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["personalparams"].ToString());
                }
                catch (Exception ex)
                {
                    message = "{status:'failure',msg:'Carryforward parameters error.'}";
                    Response.Write(message);
                    return;
                }

                lvcryfwdBll bll = new lvcryfwdBll();
                bll.CarryForward(carryforwardParameters, personalParameters);

                message = "{status:'success',msg:'Carryforward success.'}";
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_EditBad, ex, true) + "'}";
            }
            Response.Write(message);
        }
예제 #7
0
        public void exportexceldtl()
        {
            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());

                prprirstBll bll = new prprirstBll();

                int           total = 0;
                List <object> obj   = bll.GetSelectedRecords <object>(records, false, 0, 0, ref total);


                if ((obj != null) && (total > 0))
                {
                    List <object> finalObj = 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);
            }
        }
예제 #8
0
        public virtual void getDelete <T>() where T : class
        {
            string message = "{}";

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

                new BaseBll().DoDelete <T>(new List <ColumnInfo> {
                    new ColumnInfo()
                    {
                        ColumnName = "emno", ColumnValue = ht["emno"].ToString()
                    },
                    new ColumnInfo()
                    {
                        ColumnName = "sqno", ColumnValue = ht["sqno"].ToString(), ColumnType = "int"
                    }
                });
                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);
        }
예제 #9
0
        public virtual void getApplyTo <T, P>()
            where T : class
            where P : class
        {
            string message;

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

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

                List <vw_employment> empParameters = JavaScriptConvert.DeserializeObject <List <vw_employment> >(ht["empparams"].ToString());
                P obj = JavaScriptConvert.DeserializeObject <P>(ht["objparams"].ToString());

                T       bll     = (T)typeof(T).GetConstructor(new Type[] { }).Invoke(new object[] { });
                BaseBll baseBll = bll as BaseBll;

                baseBll.ApplyTo(empParameters, obj);

                message = "{status:'success',msg:'" + HRMSRes.Public_Message_AddWell + "'}";

                Response.Write(message);
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
예제 #10
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 <trcintsch> listDtl = JavaScriptConvert.DeserializeObject <List <trcintsch> >(ht["dtlparams"].ToString());

                rcintschBll bll = new rcintschBll();

                bll.CreateInterviewSchedule(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);
        }
예제 #11
0
        public void openPeriod()
        {
            string message = string.Empty;

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

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

                //string year = ht["year"].ToString();
                string period = ht["perd"].ToString();

                stperiodBll bll       = new stperiodBll();
                tstperiod   periodMdl = bll.GetPeriod(period);

                Exception_ErrorMessage result = bll.OpenPeriod(periodMdl);

                if (result.Equals(Exception_ErrorMessage.NoError))
                {
                    message = "{status:'success',msg:'" + HRMSRes.Public_Message_OpenPeriodSuccess + "'}";
                }
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_OpenPeriodFail, ex, true) + "'}";
            }
            Response.Output.Write(message);
        }
예제 #12
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());

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

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

                otaplctnBll bll = new otaplctnBll();
                bll.UpdateOTApplication(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);
        }
예제 #13
0
        public void transfer()
        {
            string            message            = "{}";
            List <ColumnInfo> transferParameters = null;
            List <ColumnInfo> personalParameters = null;

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

                try
                {
                    transferParameters = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["otttlvparams"].ToString());
                    personalParameters = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["personalparams"].ToString());
                }
                catch (Exception ex)
                {
                    message = "{status:'failure',msg:'Transfer parameters error.'}";
                    Response.Write(message);
                    return;
                }

                otttlvBll bll = new otttlvBll();
                bll.BatchTransferToLeave(transferParameters, personalParameters);

                message = "{status:'success',msg:'Transfering success.'}";
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_EditBad, ex, true) + "'}";
            }
            Response.Write(message);
        }
예제 #14
0
        public void CalcOTTime()
        {
            string message = "{}";

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

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

                otaplctnBll bll  = new otaplctnBll();
                string      json = bll.CalcOTTime(obj);

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

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

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

                otaplctnBll bll = new otaplctnBll();

                LvSettingInfo lstSettings = bll.GetEmpOTSettings(ht["emno"].ToString(), ht["otcd"].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);
            }
        }
예제 #16
0
        public void checkPeriodStatusOnly()
        {
            string message = string.Empty;

            try
            {
                string      record    = this.Request["record"];
                Hashtable   ht        = JavaScriptConvert.DeserializeObject <Hashtable>(record);
                stperiodBll periodBll = new stperiodBll();
                tstperiod   periodMdl = periodBll.GetPeriod(ht["period"].ToString());

                periodBll.CheckSelectedPeriodStatus(periodMdl);

                message = "{status:'success',msg:'" + HRMSRes.Public_Message_CheckPeriodStatusSuccess + "'}";
            }
            catch (UtilException ex)
            {
                if ((ex.Code == (int)Exception_ErrorMessage.PeriodIsUnused) ||
                    (ex.Code == (int)Exception_ErrorMessage.StepIsCompleted))
                {
                    message = "{status:'ask',msg:'" + ExceptionPaser.Parse(ex, true) + "'}";
                }
                else
                {
                    message = "{status:'fail',msg:'" + ExceptionPaser.Parse(ex, true) + "'}";
                }
            }
            catch (Exception ex)
            {
                message = "{status:'fail',msg:'" + ExceptionPaser.Parse(ex, true) + "'}";
            }

            Response.Output.Write(message);
        }
예제 #17
0
        public void getEdit()
        {
            string message = "{}";

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

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

                tatroster        obj     = JavaScriptConvert.DeserializeObject <tatroster>(ht["params"].ToString());
                List <tatrosdtl> listDtl = JavaScriptConvert.DeserializeObject <List <tatrosdtl> >(ht["dtlparams"].ToString());

                atrosterBll bll = new atrosterBll();

                bll.UpdateRoster(obj, 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);
        }
예제 #18
0
        public void publish()
        {
            string message;

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

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

                List <vw_employment> empParameters = JavaScriptConvert.DeserializeObject <List <vw_employment> >(ht["empparams"].ToString());
                string trcd = ht["objparams"].ToString();

                trtraingBll bll = new trtraingBll();

                bll.Publish(empParameters, trcd, "Y", "Y");

                message = "{status:'success',msg:'" + HRMSRes.Public_Message_AddWell + "'}";

                Response.Write(message);
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
예제 #19
0
        public virtual void getEdit <T>() where T : class
        {
            string message = "{}";

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

                List <ColumnInfo> lstParameters = new List <ColumnInfo>();
                lstParameters.Add(new ColumnInfo()
                {
                    ColumnName = "emno", ColumnValue = typeof(T).GetProperty("emno").GetValue(obj, null).ToString()
                });

                if (typeof(T).GetProperty("sqno") != null)
                {
                    lstParameters.Add(new ColumnInfo()
                    {
                        ColumnName = "sqno", ColumnValue = typeof(T).GetProperty("sqno").GetValue(obj, null).ToString(), ColumnType = "int"
                    });
                }

                new BaseBll().DoUpdate <T>(obj, lstParameters);
                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);
        }
예제 #20
0
        public void calculation()
        {
            string message = "{}";

            try
            {
                string            record             = this.Request["record"];
                Hashtable         ht                 = JavaScriptConvert.DeserializeObject <Hashtable>(record);
                string            type               = ht["type"].ToString();
                string            cond               = ht["cond"].ToString();
                List <ColumnInfo> personalParameters = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["custcond"].ToString());
                string            perd               = ht["perd"].ToString();
                string            icnj               = ht["icnj"].ToString();
                string            ictm               = ht["ictm"].ToString();
                string            pdcd               = ht["pdcd"].ToString();

                prcalculBll bll = new prcalculBll();

                bll.Calculate(type, cond, personalParameters, perd, icnj, ictm, pdcd);
                message = "{status:'success',msg:'" + "Calcualte successfully." + "'}";
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse("Calcualte fail.", ex, true) + "'}";
            }
            Response.Write(message);
        }
예제 #21
0
        public virtual void getExportExcel <T, P>() where T : class where P : class
        {
            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());

                T       bll     = (T)typeof(T).GetConstructor(new Type[] { }).Invoke(new object[] { });
                BaseBll baseBll = bll as BaseBll;

                int      total = 0;
                List <P> obj   = baseBll.GetSelectedRecords <P>(records, 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);
            }
        }
예제 #22
0
        public void logon()
        {
            string message = "";

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

                string msg = new logonBll().UserValidation(ht["urid"].ToString(), ht["pswd"].ToString(), ConfigReader.getAppName());

                if (msg.Substring(0, 7) == "success")
                {
                    tscuser user = JavaScriptConvert.DeserializeObject <tscuser>(msg.Substring(8, msg.Length - 8));
                    this.HttpContext.Session[Constant.SESSION_CURRENT_USER]  = user.urid;
                    this.HttpContext.Session[Constant.SESSION_CURRENT_STAFF] = user.sfid;//存放登录用户对应的Staff ID

                    message = "{status:'success',msg:'Verify success.'}";
                }
                else
                {
                    message = "{status:'failure',msg:'" + msg + "'}";
                }
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_EditBad, ex, true) + "'}";
            }

            Response.Write(message);
        }
예제 #23
0
        public virtual void getList <T, P>()
            where T : class
            where P : class
        {
            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"]);

                T       bll     = (T)typeof(T).GetConstructor(new Type[] { }).Invoke(new object[] {  });
                BaseBll baseBll = bll as BaseBll;

                int total = 0;

                List <P> dataList = baseBll.GetSelectedRecords <P>(list, true, start, start + limit, ref total);
                string   json     = JavaScriptConvert.SerializeObject(BuildAnonymousObject(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);
            }
        }
예제 #24
0
        public void getEdit()
        {
            string message = "{}";

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

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

                trcintasm        obj         = JavaScriptConvert.DeserializeObject <trcintasm>(ht["params"].ToString());
                List <trcintadt> listDtl     = JavaScriptConvert.DeserializeObject <List <trcintadt> >(ht["dtlparams"].ToString());
                List <string>    listDeleted = JavaScriptConvert.DeserializeObject <List <string> >(ht["dtldeletedline"].ToString());

                rcintasmBll bll = new rcintasmBll();

                bll.UpdateRecruitmentAssessment(obj, listDtl, listDeleted);
                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);
        }
예제 #25
0
        public virtual void getEdit <T, P>()
            where T : class
            where P : class
        {
            string message = "{}";

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

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

                T       bll     = (T)typeof(T).GetConstructor(new Type[] { }).Invoke(new object[] { });
                BaseBll baseBll = bll as BaseBll;

                baseBll.DoUpdate <P>(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);
        }
예제 #26
0
        public void exportExcel()
        {
            try
            {
                table_name = this.Request["tableName"];
                string record = this.Request["record"];
                string header = this.Request["header"];

                List <ColumnInfo> headers = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(header);

                List <object>     dataList   = null;
                List <ColumnInfo> parameters = new List <ColumnInfo>();

                MasterDataBll bll = new MasterDataBll();

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

                dataList = bll.GetSelectedRecords(table_name, parameters);

                if (dataList != null)
                {
                    UtilExcel.ExportToExcel(bll.GetDynamicType(table_name), Response, table_name, headers, dataList);
                }
            }
            catch (Exception ex)
            {
                string message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
예제 #27
0
        public void getPriRuleSetDtl()
        {
            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"]);

                prprirstBll bll = new prprirstBll();

                int total = 0;

                List <object> dataList = bll.GetSelectedRecords <object>(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);
            }
        }
예제 #28
0
        public void getCldDtl()
        {
            try
            {
                string action = this.Request["action"];

                if ((action != null) && (action == "generate"))
                {
                    getAutoDtl();
                    return;
                }

                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"]);

                atcaldarBll bll = new atcaldarBll();

                int total = 0;

                List <object> dataList = bll.GetCalendarDetails(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);
            }
        }
예제 #29
0
        public void create()
        {
            string msg = "{}";

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

                List <ColumnInfo> parameters = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(record);

                new MasterDataBll().InsertMasterData(table_name, parameters);

                msg = "{status:'success',msg:'" + HRMSRes.Public_Message_AddWell + "'}";
            }
            catch (UtilException ex)
            {
                if (ex.Code == -1001)
                {
                    msg = "{status:'failure',msg:'" + HRMSRes.Public_Message_AddBad + "',code:'" + Exception_ErrorMessage.IsDuplicate.ToString() + "'}";
                }
                else
                {
                    throw ex;
                }
            }
            catch (Exception ex)
            {
                msg = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_AddBad, ex, true) + "'}";
            }

            Response.Output.Write(msg);
        }
예제 #30
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);
        }