Пример #1
0
        public ActionResult ReadApprovers()
        {
            Int64 approvalFlag = -1;

            MTSHRDataLayer.Module data = new MTSHRDataLayer.Module();
            DataSet result             = data.GetApprovers(Convert.ToInt64(Session["UserID"]));

            if (result.Tables[3].Rows.Count > 0)
            {
                approvalFlag = Convert.ToInt64(result.Tables[3].Rows[0]["Approval_flag"]);
                //return Json(new { success = JsonConvert.SerializeObject(result) });
                return(Json(new { success = approvalFlag }));
            }
            else
            {
                //return Json(new { success = JsonConvert.SerializeObject(result) });
                return(Json(new { success = approvalFlag }));
            }
        }
Пример #2
0
        public static List <SelectListItem> GetApproversList()
        {
            MTSHRDataLayer.Module data          = new MTSHRDataLayer.Module();
            List <SelectListItem> ApproversList = new List <SelectListItem>();
            string USERID = null;

            try
            {
                DataSet Approver = data.GetApprovers(USERID);
                for (int i = 0; i < Approver.Tables[1].Rows.Count; i++)
                {
                    ApproversList.Add(new SelectListItem()
                    {
                        Value = Approver.Tables[1].Rows[i]["UserId"].ToString(), Text = Approver.Tables[1].Rows[i]["Approver"].ToString()
                    });
                }
            }
            catch (Exception exec)
            {
                BaseExceptionHandler.HandleException(ref exec);
            }
            return(ApproversList);
        }