Exemple #1
0
        public JsonResult Select_List_HCP_Info(string text, string value)
        {
            var temp = Services_HCP_Info.Instance().ListMany(a => a.Status != "Blocked" && a.Status != "Deleted")
                       .ToList();

            List <SelectListItem> list = new List <SelectListItem>();

            if (!string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(value))
            {
                list.Add(new SelectListItem
                {
                    Text     = text,
                    Selected = true,
                    Value    = value
                });
            }

            foreach (var item in temp)
            {
                list.Add(new SelectListItem
                {
                    Text  = item.Code + " - " + item.Full_Name + " - " + item.Citizen_ID,
                    Value = item.Code
                });
            }

            return(Json(list));
        }
Exemple #2
0
        public ActionResult HCP_EditView(int id)
        {
            var data = Services_HCP_Info.Instance().Get(a => a.ID == id);

            ViewData["hcp_info"] = data;
            return(PartialView());
        }
Exemple #3
0
        public JsonResult Event_Import_HCP_Info(int rowIndex)
        {
            List <Message> ms_error = new List <Message>();

            if (Session["hcp_info_error"] != null)
            {
                ms_error = (List <Message>)Session["sos_schedule_error"];
            }
            Message   ms = new Message();
            DataTable dt = (DataTable)Session["hcp_info"];

            var rowCurrent = dt.Rows[rowIndex];

            HCP_Info model = new HCP_Info()
            {
                Full_Name    = rowCurrent[1].ToString(),
                Birth_Day    = !string.IsNullOrEmpty(rowCurrent[2].ToString()) ? DateTime.Parse(rowCurrent[2].ToString()) : (DateTime?)null,
                Address      = rowCurrent[3].ToString(),
                Citizen_ID   = !string.IsNullOrEmpty(rowCurrent[4].ToString()) ? rowCurrent[4].ToString() : "",
                Issue_Date   = !string.IsNullOrEmpty(rowCurrent[5].ToString()) ? DateTime.Parse(rowCurrent[5].ToString()) : (DateTime?)null,
                Place_Issue  = rowCurrent[6].ToString(),
                PIT_Code     = rowCurrent[7].ToString(),
                Position     = rowCurrent[8].ToString(),
                Bank_Name    = rowCurrent[9].ToString(),
                Bank_Account = rowCurrent[10].ToString(),
                Note         = rowCurrent[11].ToString(),
                Create_User  = Session["user"].ToString(),
                Create_Date  = DateTime.Now
            };

            ms = Services_HCP_Info.Instance().Event_Import_HCP_Info(model, rowIndex);

            if (ms.code == "1")
            {
                ms_error.Add(ms);
                ms.code = "0";
            }
            if (rowIndex == dt.Rows.Count - 1)
            {
                if (ms_error.Count > 0)
                {
                    Session["sos_schedule_error"] = ms_error;
                    ms.code     = "1";
                    ms.msg      = "Vui lòng xem file Excel Lỗi !";
                    ms.sub_code = "Danh Sách Thông Tin Chấm SOS Lỗi";
                }
                else
                {
                    ms.code = "2";
                    ms.msg  = "Đã Up Danh Sách Thông Tin Chấm SOS Thành Công";
                }
            }
            else
            {
                Session["sos_schedule_error"] = ms_error;
            }
            return(Json(ms));
        }
Exemple #4
0
        public JsonResult EventExportHCP_Info()
        {
            string fromdate     = Request["fromdate"].ToString();
            string todate       = Request["todate"].ToString();
            string Place_Issue2 = Request["Place_Issue2"].ToString();

            var    nameFile  = "Template_Export_HCP_Info";
            string nameSheet = "Template_Export_HCP_Info";

            MemoryStream ms = new MemoryStream();

            ms = Services_HCP_Info.Instance().Get_Template_Excel_Report_HCP(Server, nameFile, nameSheet, fromdate, todate, Place_Issue2);
            string file_name = "Template_Export_HCP_Info" + System.DateTime.Now.ToShortDateString().Replace("/", "_") + ".xlsx";

            Session[file_name] = ms;
            return(Json(new { success = true, file_name }, JsonRequestBehavior.AllowGet));
        }
Exemple #5
0
        public ActionResult Event_Add_Edit_HCP_Info(string data, string CMND_MT, string CMND_MS, string issue)
        {
            Message  ms         = new Message();
            DateTime issue_date = Convert.ToDateTime(issue);
            HCP_Info hcp        = JsonConvert.DeserializeObject <HCP_Info>(data);
            string   cm_truoc   = Cut_Image(CMND_MT);
            string   cm_sau     = Cut_Image(CMND_MS);

            hcp.CMND_MT     = ResizeBase64String_500(cm_truoc);
            hcp.CMND_MS     = ResizeBase64String_500(cm_sau);
            hcp.Status      = "Update";
            hcp.Issue_Date  = issue_date;
            hcp.Create_Date = DateTime.Now.Date;
            hcp.Create_User = Session["user"].ToString();
            ms = Services_HCP_Info.Instance().Event_Add_Edit_HCP(hcp);
            return(Json(ms));
        }
Exemple #6
0
        public JsonResult Event_Delete_HCP_Info(string id, string user)
        {
            var result = Services_HCP_Info.Instance().Event_Delete_HCP_Info(id, user);

            return(Json(result));
        }