Exemplo n.º 1
0
        public static string AssignedToMe(string cgi)
        {
            try
            {
                CryptoJS objcryptoJS     = new CryptoJS();
                string   ContractorAppId = string.Empty;
                ContractorAppId = cgi.ToString() == null ? string.Empty : cgi.ToString();
                if (GlobalMethods.ValueIsNull(ContractorAppId).Length > 0)
                {
                    ContractorAppId = objcryptoJS.AES_decrypt(HttpUtility.UrlEncode(cgi), AppConstants.secretKey, AppConstants.initVec).ToString();
                }

                clsRiskAssessor_Approval objRiskApp = new clsRiskAssessor_Approval();
                objRiskApp.InspectorRiskAssId         = Convert.ToInt32(ContractorAppId);
                objRiskApp.MDE_Owner_AuthorisedUserId = Convert.ToInt32(HttpContext.Current.Session["UserAuthId"]);
                //objRiskApp.CreateDate = DateTime.Now;
                //objRiskApp.CreatedBy = HttpContext.Current.Session["UserAuthId"].ToString();
                //objRiskApp.UpdatedDate = Convert.ToDateTime("1/1/1900");
                //objRiskApp.UpdatedBy = "";
                objRiskApp.Notes    = "";
                objRiskApp.IsActive = 1;
                if (!RiskAssessor_ApprovalDAL.InsertRiskAssessor_Approval(objRiskApp))
                {
                }
            }
            catch (Exception)
            {
                ErrorHandler.ErrorPage();
            }

            return("MDE_RiskApps.aspx?riskapps=active");
        }
Exemplo n.º 2
0
        public static Boolean InsertUpdateRiskAssessor_Approval(clsRiskAssessor_Approval objRiskAssessor_Approval)
        {
            bool   isAdded = false;
            string SpName  = "usp_InsertUpdateRiskAssessor_Approval";

            try
            {
                using (IDbConnection db = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["databaseConnection"]))
                {
                    db.Execute(SpName, objRiskAssessor_Approval, commandType: CommandType.StoredProcedure);
                }
                isAdded = true;
            }
            catch (Exception ex)
            {
                ErrorHandler.ErrorLogging(ex, false);
                ErrorHandler.ReadError();
            }
            return(isAdded);
        }
Exemplo n.º 3
0
        public static clsRiskAssessor_Approval SelectRiskAssessor_ApprovalById(int?MDEInspRiskAssApprovalId)
        {
            clsRiskAssessor_Approval objRiskAssessor_Approval = new clsRiskAssessor_Approval();
            bool   isnull = true;
            string SpName = "usp_SelectRiskAssessor_Approval";
            var    objPar = new DynamicParameters();

            if (String.IsNullOrEmpty(MDEInspRiskAssApprovalId.ToString()))
            {
                throw new ArgumentException("Function parameters cannot be blank!");
            }
            else
            {
                try
                {
                    objPar.Add("@MDEInspRiskAssApprovalId", MDEInspRiskAssApprovalId, dbType: DbType.Int32);

                    using (IDbConnection db = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["databaseConnection"]))
                    {
                        objRiskAssessor_Approval = db.Query <clsRiskAssessor_Approval>(SpName, objPar, commandType: CommandType.StoredProcedure).SingleOrDefault();
                        isnull = false;
                    }
                }
                catch (Exception ex)
                {
                    ErrorHandler.ErrorLogging(ex, false);
                    ErrorHandler.ReadError();
                }
            }

            if (isnull)
            {
                return(null);
            }
            else
            {
                return(objRiskAssessor_Approval);
            }
        }