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); }
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); }