예제 #1
0
 public JsonResult GetBankAccountInfo()
 {
     try
     {
         var param = new
         {
             OrganizationId = 0,
             RoutingNo      = "",
             BankBranchId   = 0,
             BankId         = 0,
         };
         var Master     = spService.GetDataWithParameter(param, "USP_GET_BANK_ACCOUNT_LIST");
         var BranchInfo = Master.Tables[0].AsEnumerable()
                          .Select(row => new
         {
             RowSl                 = row.Field <string>("RowSl"),
             Id                    = row.Field <int>("Id"),
             BankBranchId          = row.Field <int?>("BankBranchId"),
             OrganizationId        = row.Field <int?>("OrganizationId"),
             BankId                = row.Field <int?>("BankId"),
             BranchName            = row.Field <string>("BranchName"),
             RoutingNo             = row.Field <string>("RoutingNo"),
             BankName              = row.Field <string>("BankName"),
             OrganizationName      = row.Field <string>("OrganizationName"),
             BankAccountNo         = row.Field <string>("BankAccountNo"),
             OrganizationShortName = row.Field <string>("OrganizationShortName"),
         }).ToList();
         return(Json(BranchInfo, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(Json(new { Result = "ERROR", Message = ex.Message }, JsonRequestBehavior.AllowGet));
     }
 }
예제 #2
0
        public void Get_GeneralReport(int reportNo, string Qtype, string exportType)
        {
            if (Qtype == "Occupation" || Qtype == "Relation" || Qtype == "Designation" || Qtype == "Department")
            {
                var data =
                    sPService.GetDataWithParameter(
                        new { Qtype = Qtype },
                        "Rpt_Get_Occupation_Relation_Designation").Tables[0];
                var reportParam = new Dictionary <string, object> {
                    { "param_orgName", "Ucas" }
                };
                if (Qtype == "Occupation")
                {
                    ReportHelper.ShowReport(data, exportType, "rpt_Occupation.rpt", "rpt_Occupation", reportParam);
                }
                else if (Qtype == "Relation")
                {
                    ReportHelper.ShowReport(data, exportType, "rpt_Relation.rpt", "rpt_Relation", reportParam);
                }
                else if (Qtype == "Designation")
                {
                    ReportHelper.ShowReport(data, exportType, "rpt_Designation.rpt", "rpt_Designation", reportParam);
                }
                else if (Qtype == "Department")
                {
                    ReportHelper.ShowReport(data, exportType, "rpt_Department.rpt", "rpt_Department", reportParam);
                }
            }

            else
            {
                var data2 =
                    sPService.GetDataWithParameter(
                        new { Qtype = Qtype },
                        "Rpt_Get_Country_Divition_District_Thana").Tables[0];
                var reportParam = new Dictionary <string, object> {
                    { "param_orgName", "Ucas" }
                };

                if (Qtype == "Country")
                {
                    ReportHelper.ShowReport(data2, exportType, "rpt_Country.rpt", "rpt_Country", reportParam);
                }
                else if (Qtype == "Division")
                {
                    ReportHelper.ShowReport(data2, exportType, "rpt_Division.rpt", "rpt_Division", reportParam);
                }
                else if (Qtype == "District")
                {
                    ReportHelper.ShowReport(data2, exportType, "rpt_District.rpt", "rpt_District", reportParam);
                }
                else if (Qtype == "Thana")
                {
                    ReportHelper.ShowReport(data2, exportType, "rpt_Thana.rpt", "rpt_Thana", reportParam);
                }
            }
        }
예제 #3
0
        public JsonResult GetThanaList(string DistrictId, string DivisionId)
        {
            var Thana = spService.GetDataWithParameter(new
            {
                DIVISION_ID = DivisionId,
                DISTRICT_ID = DistrictId
            }, "USP_GET_THANA_LIST").Tables[0].AsEnumerable().Select(x => new { Id = x.Field <int>(0), ThanaName = x.Field <string>(1), DistrictName = x.Field <string>(2) }).ToList();

            return(Json(Thana, JsonRequestBehavior.AllowGet));
        }
예제 #4
0
        public JsonResult GetAccessReportList(int userid, string projectShortName)
        {
            var roleid = aspNetUserService.GetByUserId(userid).RoleId;
            var report = reportAccessService.GetAll().Where(x => x.UserId == userid && x.IsActive).ToList();
            var module = spService.GetDataWithParameter(new { USER_ROLE_ID = roleid, Project_Short_Name = projectShortName }, "USP_GET_ALL_Report_Module").Tables[0].AsEnumerable()
                         .Select(x => new AspNetSecurityModule()
            {
                AspNetSecurityModuleId = x.Field <int>(0), LinkText = x.Field <string>(1)
            })
                         .ToList();

            return(Json(new { Report = report, Module = module }, JsonRequestBehavior.AllowGet));
        }
예제 #5
0
        public JsonResult GetEmployeeNotification()
        {
            try
            {
                var param        = new { EmployeeId = SessionHelper.LoggedInUserId };
                var NotiListData = spService.GetDataWithParameter(param, "GetEmployeeNotification");

                var NotiList = NotiListData.Tables[0].AsEnumerable()
                               .Select(row => new
                {
                    employee_id = row.Field <int>("employee_id"),
                    LoactionURL = row.Field <string>("LoactionURL"),
                    NotiNo      = row.Field <int>("NotiNo"),
                    NotiType    = row.Field <string>("NotiType"),
                    NotiTex     = row.Field <string>("NotiTex")
                }).ToList();

                return(Json(NotiList, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new { Result = "ERROR", Message = ex.Message }));
            }
        }
예제 #6
0
 public JsonResult GenerateDatabaseBackup()
 {
     try
     {
         var location = ConfigurationManager.AppSettings["DatabaseBackupPath"];
         var context  = new CommonDbContext();
         var database = context.Database.Connection.Database;
         //spService.GetDataBySqlCommand(@"BACKUP DATABASE " + database + " TO DISK = '" + path + "'");
         spService.GetDataWithParameter(new { DATABASE_NAME = database, BACK_UP_PATH = location },
                                        "USP_GENERATE_DATABASE_BACKUP");
     }
     catch (Exception ex)
     {
         return(Json(new { Status = false, Message = ex.InnerException == null ? ex.Message : ex.InnerException.Message }, JsonRequestBehavior.AllowGet));
     }
     return(Json(new { Status = true, Message = "Backup Successfull." }, JsonRequestBehavior.AllowGet));
 }
예제 #7
0
        public IEnumerable <UcasSoftwareProjects> GetAllProject(int roleId, string ProjectShortName)
        {
            var param    = new { RoleId = roleId, ProjectShortName = ProjectShortName };
            var Projects = spService.GetDataWithParameter(param, "GetRole_wise_AllUcasProject");// spService.GetDataBySqlCommand("SELECT DISTINCT M.ProjectShortName FROM AspNetRoleModule AS R INNER JOIN AspNetSecurityModule AS M ON M.AspNetSecurityModuleId = R.ModuleId WHERE R.IsActive = 1 AND R.RoleId = " + roleId + "");//.Tables[0].AsEnumerable().Select(row => new { ProjectShortName = row.Field<string>("ProjectShortName") }).ToList();

            List <UcasSoftwareProjects> ProjectList = new List <UcasSoftwareProjects>();

            foreach (DataRow p in Projects.Tables[0].Rows)
            {
                ProjectList.Add(new UcasSoftwareProjects {
                    ProjectName = p["ProjectName"].ToString(), ProjectShortName = p["ProjectShortName"].ToString(), StyleCss = p["StyleCss"].ToString(), ProjectHomePage = p["ProjectHomePage"].ToString()
                });
            }
            var UserProject = ProjectList.ToList();

            return(UserProject);
        }
예제 #8
0
 public JsonResult DeleteProfession(int id)
 {
     try
     {
         var client = spService.GetDataWithParameter(new { ID = id }, "USP_CHECK_PROFESSION_USE").Tables[0].AsEnumerable();
         if (!client.Any())
         {
             var profession = professionService.GetById(id);
             profession.IsActive = false;
             professionService.Update(profession);
             return(Json(new { Status = true, Message = "Profession delete successfull." }, JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Json(new { Status = false, Message = "Delete deny.There are client/joint client/nominee with this profession." }, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception ex)
     {
         return(Json(new { Status = false, Message = ex.GetErrorMessage() }, JsonRequestBehavior.AllowGet));
     }
 }