Example #1
0
 public JsonResult GetWorkList()
 {
     using (MotCuaService = new MotCuaServiceClient())
     {
         var userId = User.UserID;
         var data   = MotCuaService.MotCua_WorkList_CountByTrangThaiHoSoIDId_UserID(userId);
         if (data.StatusCode == HttpStatusCode.OK)
         {
             return(Json(data.Data, JsonRequestBehavior.AllowGet));
         }
     }
     return(Json(null, JsonRequestBehavior.AllowGet));
 }
Example #2
0
 public JsonResult GetDMChungTuKemTheoByThuTucID(string ThuTucID)
 {
     try
     {
         using (MotCuaService = new MotCuaServiceClient())
         {
             var response = MotCuaService.MotCua_DM_ChungTuKemTheo_GetByThuTucID(int.Parse(ThuTucID));
             return(Json(response.StatusCode != HttpStatusCode.OK ? null : new { response.Content }, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception e)
     {
         Logger.Error(e.Message);
         Console.WriteLine(e);
         throw;
     }
 }
Example #3
0
 public JsonResult GetQuyTrinhBuocNguoiNhanByBuocID(string BuocID)
 {
     try
     {
         using (MotCuaService = new MotCuaServiceClient())
         {
             var response = MotCuaService.MotCua_DM_QuyTrinh_Buoc_NguoiNhan_ListByBuocID(int.Parse(BuocID));
             return(Json(response.StatusCode != HttpStatusCode.OK ? null : new { response.Content }, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception e)
     {
         Logger.Error(e.Message);
         Console.WriteLine(e);
         throw;
     }
 }
Example #4
0
 public JsonResult GetHoSoById(string hosoId)
 {
     try
     {
         using (MotCuaService = new MotCuaServiceClient())
         {
             var response = MotCuaService.MotCua_HoSoTiepNhan_GetByHoSoId(hosoId.ToLong());
             return(Json(response.StatusCode != HttpStatusCode.OK ? null : new { response.Content }, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception e)
     {
         Logger.Error(e.Message);
         Console.WriteLine(e);
         throw;
     }
 }
Example #5
0
        public JsonResult SaveDMQuyTrinhThuTuc()
        {
            try
            {
                using (MotCuaService = new MotCuaServiceClient())
                {
                    var nguoixulylength = Request.Form["nguoixulylength"];
                    int nxllen          = int.Parse(nguoixulylength);

                    var modelquytrinh = Request.Form["modelquytrinh"];
                    var itemquytrinh  = JsonConvert.DeserializeObject <DM_QuyTrinh_Buoc>(modelquytrinh);
                    if (Session["DMBuocID"] != null && Session["DMBuocID"].ToString() != "0")
                    {
                        itemquytrinh.BuocID = Session["DMBuocID"].ToString().ToInt();
                    }

                    var lstDM_QuyTrinh_Buoc_NguoiNhan = new List <DM_QuyTrinh_Buoc_NguoiNhan>();
                    for (int i = 0; i < nxllen; i++)
                    {
                        var modelquytrinh_nguoinhan = Request.Form["model" + i.ToString()];
                        var itemquytrinh_nguoinhan  = JsonConvert.DeserializeObject <DM_QuyTrinh_Buoc_NguoiNhan>(modelquytrinh_nguoinhan);

                        if (itemquytrinh.BuocID != 0)
                        {
                            itemquytrinh_nguoinhan.BuocID = itemquytrinh.BuocID;
                        }
                        lstDM_QuyTrinh_Buoc_NguoiNhan.Add(itemquytrinh_nguoinhan);
                    }

                    var dM_QuyTrinh_Buoc_NguoiNhanSave = new DM_QuyTrinh_Buoc_NguoiNhanSave();
                    dM_QuyTrinh_Buoc_NguoiNhanSave.dm_QuyTrinh_Buoc = itemquytrinh;
                    dM_QuyTrinh_Buoc_NguoiNhanSave.lstDM_QuyTrinh_Buoc_NguoiNhan = lstDM_QuyTrinh_Buoc_NguoiNhan;

                    var response = MotCuaService.MotCua_DM_QuyTrinh_Buoc_NguoiNhan_Save(dM_QuyTrinh_Buoc_NguoiNhanSave);
                    Session["DMBuocID"] = null;
                    return(Json(response.StatusCode != HttpStatusCode.OK ? null : new { response.Content }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception e)
            {
                Logger.Error(e.Message);
                Console.WriteLine(e);
                throw;
            }
        }
Example #6
0
 public JsonResult GetLinhVucByLinhVucID(string LinhVucID)
 {
     try
     {
         using (MotCuaService = new MotCuaServiceClient())
         {
             Session["DMLinhVucID"] = LinhVucID;
             var response = MotCuaService.MotCua_DM_LinhVuc_GetByLinhVucID(int.Parse(LinhVucID));
             return(Json(response.StatusCode != HttpStatusCode.OK ? null : new { response.Content }, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception e)
     {
         Logger.Error(e.Message);
         Console.WriteLine(e);
         throw;
     }
 }
Example #7
0
 public JsonResult GetTrangThai()
 {
     try
     {
         using (MotCuaService = new MotCuaServiceClient())
         {
             var response = MotCuaService.MotCua_E_TrangThaiHoSo_GetAll();
             if (response.StatusCode != HttpStatusCode.OK)
             {
                 return(Json(new { result = "" }, JsonRequestBehavior.AllowGet));
             }
             return(Json(new { result = response.Content }, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception e)
     {
         Logger.Error(e.Message);
         Console.WriteLine(e);
         throw;
     }
 }
Example #8
0
 public JsonResult GetThuTucByLinhVucIDJsonResult(int linhvucID = 0)
 {
     try
     {
         using (MotCuaService = new MotCuaServiceClient())
         {
             var response = MotCuaService.MotCua_DM_ThuTuc_GetByLinhVucID(linhvucID);
             if (response.StatusCode != HttpStatusCode.OK)
             {
                 return(Json(new { result = "" }, JsonRequestBehavior.AllowGet));
             }
             return(Json(new { result = response.Content }, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception e)
     {
         Logger.Error(e.Message);
         Console.WriteLine(e);
         throw;
     }
 }
Example #9
0
 public JsonResult GetChungTuKemTheoByHoSoIDJsonResult(int hoSoID = 0)
 {
     try
     {
         using (MotCuaService = new MotCuaServiceClient())
         {
             var response = MotCuaService.MotCua_ChungTuKemTheo_GetByHoSoID(hoSoID);
             if (response.StatusCode != HttpStatusCode.OK)
             {
                 return(Json(new { result = "" }, JsonRequestBehavior.AllowGet));
             }
             return(Json(new { result = response.Content }, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception e)
     {
         Logger.Error(e.Message);
         Console.WriteLine(e);
         throw;
     }
 }
Example #10
0
 public JsonResult MotCua_KiemTraSoBienNhan(string SoBienNhan)
 {
     try
     {
         using (MotCuaService = new MotCuaServiceClient())
         {
             var response = MotCuaService.MotCua_KiemTraSoBienNhan(SoBienNhan);
             if (response.StatusCode != HttpStatusCode.OK)
             {
                 return(Json(new { result = "" }, JsonRequestBehavior.AllowGet));
             }
             return(Json(new { result = response.Content }, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception e)
     {
         Logger.Error(e.Message);
         Console.WriteLine(e);
         throw;
     }
 }
Example #11
0
        public JsonResult SaveDMThuTuc()
        {
            try
            {
                using (MotCuaService = new MotCuaServiceClient())
                {
                    var modelDM_ThuTuc = Request.Form["model"];
                    var dm_ThuTuc      = JsonConvert.DeserializeObject <DM_ThuTuc>(modelDM_ThuTuc);
                    if (Session["DMThuTucID"] != null && Session["DMThuTucID"].ToString() != "0")
                    {
                        dm_ThuTuc.ThuTucID = Session["DMThuTucID"].ToString().ToInt();
                    }

                    var modelDM_ChungTuKemTheo = Request.Form["chungtukemtheo"];
                    var lstdm_ChungTuKemTheo   = JsonConvert.DeserializeObject <List <DM_ChungTuKemTheo> >(modelDM_ChungTuKemTheo ?? "");

                    if (dm_ThuTuc.ThuTucID != 0)
                    {
                        foreach (var item in lstdm_ChungTuKemTheo)
                        {
                            item.ThuTucID = dm_ThuTuc.ThuTucID;
                        }
                    }

                    var dM_ThuTucSave = new DM_ThuTucSave();
                    dM_ThuTucSave.dm_ThuTuc            = dm_ThuTuc;
                    dM_ThuTucSave.lstDM_ChungTuKemTheo = lstdm_ChungTuKemTheo;

                    var response = MotCuaService.MotCua_DM_ThuTuc_Save(dM_ThuTucSave);
                    Session["DMThuTucID"] = null;
                    return(Json(response.StatusCode != HttpStatusCode.OK ? null : new { response.Content }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception e)
            {
                Logger.Error(e.Message);
                Console.WriteLine(e);
                throw;
            }
        }
Example #12
0
        public IList <DM_ThuTucList> MotCua_DM_ThuTucList(DataTableAjaxPostModel model,
                                                          out int filteredResultsCount, string tuKhoa, out int totalResultsCount)
        {
            try
            {
                var take      = model.length;
                var skip      = model.start != 0 ? model.start / take : 0;
                var pageindex = skip + 1;
                var result    = new List <DM_ThuTucList>();
                using (MotCuaService = new MotCuaServiceClient())
                {
                    var data = MotCuaService.MotCua_DM_ThuTuc_List(tuKhoa, pageindex, take);
                    if (data.StatusCode == HttpStatusCode.OK)
                    {
                        result = data.Data.Data;
                    }
                }
                var totalCount = 0;

                if (result != null && result.Any())
                {
                    totalCount = result.First().TotalItems ?? 0;
                }

                filteredResultsCount = totalCount;
                totalResultsCount    = totalCount;

                if (result == null)
                {
                    return(new List <DM_ThuTucList>());
                }
                return(result);
            }
            catch (Exception e)
            {
                Logger.Error(e.Message);
                Console.WriteLine(e);
                throw;
            }
        }
Example #13
0
 public JsonResult XoaHoSoByHoSoID(long hosoId, string trangThaiHoSoID)
 {
     try
     {
         using (MotCuaService = new MotCuaServiceClient())
         {
             var response = MotCuaService.MotCua_HoSoTiepNhan_DelFullProcess(new HoSoTiepNhanFullProcessDel
             {
                 HoSoID          = hosoId,
                 UserId          = User.UserID,
                 TrangThaiHoSoId = trangThaiHoSoID.ToIntNullable(),
             });
             return(Json(response.StatusCode != HttpStatusCode.OK ? null : new { response.Content }, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception e)
     {
         Logger.Error(e.Message);
         Console.WriteLine(e);
         throw;
     }
 }
Example #14
0
 public JsonResult SaveDMLinhVuc()
 {
     try
     {
         using (MotCuaService = new MotCuaServiceClient())
         {
             var model = Request.Form["model"];
             var item  = JsonConvert.DeserializeObject <DM_LinhVuc>(model);
             if (Session["DMLinhVucID"] != null && Session["DMLinhVucID"].ToString() != "0")
             {
                 item.LinhVucID = Session["DMLinhVucID"].ToString().ToInt();
             }
             var response = MotCuaService.MotCua_DM_LinhVuc_Save(item);
             Session["DMLinhVucID"] = null;
             return(Json(response.StatusCode != HttpStatusCode.OK ? null : new { response.Content }, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception e)
     {
         Logger.Error(e.Message);
         Console.WriteLine(e);
         throw;
     }
 }
Example #15
0
        public JsonResult SaveHoSo()
        {
            try
            {
                using (MotCuaService = new MotCuaServiceClient())
                {
                    var hoso              = Request.Form["hoso"];
                    var chungtukemtheo    = Request.Form["chungtukemtheo"];
                    var lstChungTu        = JsonConvert.DeserializeObject <List <MotCua_ChungTuKemTheoViewModel> >(chungtukemtheo ?? "");
                    var lstChungTuKemTheo = new List <ChungTuKemTheo>();
                    foreach (var item in lstChungTu)
                    {
                        var file = Request.Files[item.DinhKemID];
                        var link = "";
                        if (file != null)
                        {
                            link = XuLyLuuFile(file);
                        }
                        lstChungTuKemTheo.Add(new ChungTuKemTheo
                        {
                            TenChungTu = item.TenChungTu,
                            SLBanChinh = item.SLBanChinh,
                            SLBanSao   = item.SLBanSao,
                            SLPhoto    = item.SLBanPhoTo,
                            GhiChu     = item.GhiChu,
                            AttachFile = link != "" ? link : item.AttachFile
                        });
                    }
                    //var trangthaihoso = MotCuaService.c;

                    //var objFileDinhKemName = XuLyLuuFileMultiple(_files);
                    var objHoSoTiepNhan  = JsonConvert.DeserializeObject <MotCua_HoSoTiepNhanViewModel>(hoso);
                    var hoSoTiepNhanSave = new HoSoTiepNhanSave
                    {
                        HoSoTiepNhan = new HoSoTiepNhan
                        {
                            HoSoID              = objHoSoTiepNhan.HoSoID,
                            SoBienNhan          = objHoSoTiepNhan.SoBienNhan,
                            NgayNhan            = objHoSoTiepNhan.NgayNhan.ToDateTimeNullable(),
                            NgayHenTra          = objHoSoTiepNhan.NgayHenTra.ToDateTimeNullable(),
                            LinhVucID           = objHoSoTiepNhan.LinhVuc,
                            TenLinhVuc          = objHoSoTiepNhan.LinhVuc_Name,
                            ThuTucID            = objHoSoTiepNhan.ThuTuc,
                            TenThuTuc           = objHoSoTiepNhan.ThuTuc_Name,
                            HoTenNguoiNop       = objHoSoTiepNhan.HoTenNguoiNop,
                            GioiTinhID          = objHoSoTiepNhan.GioiTinh,
                            NgaySinh            = objHoSoTiepNhan.NgaySinh,
                            TinhThanhID         = objHoSoTiepNhan.ThuongTruTinh,
                            TenTinhThanh        = objHoSoTiepNhan.ThuongTruTinh_Name,
                            QuanHuyenID         = objHoSoTiepNhan.ThuongTruHuyen,
                            TenQuanHuyen        = objHoSoTiepNhan.ThuongTruHuyen_Name,
                            PhuongXaID          = objHoSoTiepNhan.ThuongTruPhuong,
                            TenPhuongXa         = objHoSoTiepNhan.ThuongTruPhuong_Name,
                            SoNha               = objHoSoTiepNhan.ThuongTruSoNha,
                            LoaiGiayToID        = objHoSoTiepNhan.LoaiGiayTo,
                            SoGiayTo            = objHoSoTiepNhan.SoGiayTo,
                            NgayCapGiayTo       = objHoSoTiepNhan.NgayCap.ToDateTimeNullable(),
                            NoiCapGiayTo        = objHoSoTiepNhan.NoiCap,
                            Phone               = objHoSoTiepNhan.DienThoai,
                            Email               = objHoSoTiepNhan.Email,
                            CreatedUserID       = User.UserID,
                            LastUpdUserID       = User.UserID,
                            HienNayTinhThanhID  = objHoSoTiepNhan.HienNayTinh,
                            HienNayTenTinhThanh = objHoSoTiepNhan.HienNayTinh_Name,
                            HienNayQuanHuyenID  = objHoSoTiepNhan.HienNayHuyen,
                            HienNayTenQuanHuyen = objHoSoTiepNhan.HienNayHuyen_Name,
                            HienNayPhuongXaID   = objHoSoTiepNhan.HienNayPhuong,
                            HienNayTenPhuongXa  = objHoSoTiepNhan.HienNayPhuong_Name,
                            HienNaySoNha        = objHoSoTiepNhan.HienNaySoNha,
                            LePhi               = objHoSoTiepNhan.LePhi,
                            GhiChu              = objHoSoTiepNhan.GhiChu,
                            TrinhDoChuyenMonID  = objHoSoTiepNhan.TrinhDoChuyenMon,
                            TenTrinhDoChuyenMon = objHoSoTiepNhan.TrinhDoChuyenMon_Name,
                            HinhThucToChucID    = objHoSoTiepNhan.HinhThucToChuc,
                            TenHinhThucToChuc   = objHoSoTiepNhan.HinhThucToChuc_Name,
                            NoiNhanKetQuaID     = objHoSoTiepNhan.NoiNhanKetQua
                        },
                        lstChungTuKemTheo = lstChungTuKemTheo
                    };
                    var json     = new JavaScriptSerializer().Serialize(hoSoTiepNhanSave);
                    var response = MotCuaService.MotCua_HoSoTiepNhan_Save(hoSoTiepNhanSave);
                    if (response.StatusCode != HttpStatusCode.OK)
                    {
                        return(Json(new { result = "" }, JsonRequestBehavior.AllowGet));
                    }
                    return(Json(new { result = response.Content }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception e)
            {
                Logger.Error(e.Message);
                Console.WriteLine(e);
                throw;
            }
        }
Example #16
0
        public ActionResult InBienNhan(int hoSoID)
        {
            try
            {
                var tableChungTu = new DataTable();
                //Thong tin chung
                var hosotiepnhan = new DataTableViewModel();
                using (MotCuaService = new MotCuaServiceClient())
                {
                    var data = MotCuaService.MotCua_HoSoTiepNhan_InBienNhan(hoSoID);
                    if (data.StatusCode == HttpStatusCode.OK || data.Data == null)
                    {
                        hosotiepnhan = data.Data;
                    }
                    else
                    {
                        return new JsonResult()
                               {
                               }
                    };
                }
                var fields = new List <string>();
                var value  = new List <object>();
                foreach (var col in hosotiepnhan.Columns)
                {
                    fields.Add(col.Name);
                }
                foreach (var row in hosotiepnhan.Rows)
                {
                    foreach (var cell in row.Cells)
                    {
                        value.Add(cell.Value);
                    }
                }
                //Chung tu kem theo
                var chungtukemtheo = new List <ChungTuKemTheo>();
                using (MotCuaService = new MotCuaServiceClient())
                {
                    var data = MotCuaService.MotCua_ChungTuKemTheo_GetByHoSoID(hoSoID);
                    if (data.StatusCode == HttpStatusCode.OK || data.Data == null)
                    {
                        chungtukemtheo = data.Data;
                    }
                    else
                    {
                        return new JsonResult()
                               {
                               }
                    };
                }
                if (chungtukemtheo.Count == 0)
                {
                    chungtukemtheo.Add(new ChungTuKemTheo {
                        STT = 0, TenChungTu = ""
                    });
                }
                tableChungTu           = chungtukemtheo.ToDataTable();
                tableChungTu.TableName = "tableChungTu";
                var template = Server.MapPath(@"~/Upload/Template/InBienNhan.doc");
                var doc      = new Document(template);
                doc.MailMerge.Execute(fields.ToArray(), value.ToArray());

                doc.MailMerge.ExecuteWithRegions(tableChungTu);
                doc.MailMerge.ExecuteWithRegions(tableChungTu);
                MemoryStream stream = new MemoryStream();
                doc.Save(stream, SaveFormat.Doc);
                stream.Position = 0;

                return(new JsonResult()
                {
                    Data = new { Data = Convert.ToBase64String(stream.ToArray()), FileName = "InBienNhan" + hoSoID + ".doc" }
                });
            }
            catch (Exception e)
            {
                Logger.Error(e.Message);
                Console.WriteLine(e);
                throw;
            }
        }