Exemple #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();
                }

                clsTP_Approval objRiskApp = new clsTP_Approval();
                objRiskApp.TPId = Convert.ToInt32(ContractorAppId);
                objRiskApp.MDE_Owner_AuthorisedUserId = Convert.ToInt32(HttpContext.Current.Session["UserAuthId"]);
                objRiskApp.CreatedDate = DateTime.Now;
                objRiskApp.CreatedBy   = HttpContext.Current.Session["UserAuthId"].ToString();
                objRiskApp.UpdatedDate = Convert.ToDateTime("1/1/1900");
                objRiskApp.UpdatedBy   = "";
                objRiskApp.Notes       = "";
                objRiskApp.IsActive    = 1;
                if (!TP_ApprovalDAL.InsertTP_Approval(objRiskApp))
                {
                }
            }
            catch (Exception)
            {
                ErrorHandler.ErrorPage();
            }

            return("MDE_TPApps.aspx?tpapps=active");
        }
Exemple #2
0
        public static Boolean InsertUpdateTP_Approval(clsTP_Approval objTP_Approval)
        {
            bool   isAdded = false;
            string SpName  = "usp_InsertUpdateTP_Approval";

            try
            {
                using (IDbConnection db = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["databaseConnection"]))
                {
                    db.Execute(SpName, objTP_Approval, commandType: CommandType.StoredProcedure);
                }
                isAdded = true;
            }
            catch (Exception ex)
            {
                ErrorHandler.ErrorLogging(ex, false);
                ErrorHandler.ReadError();
            }
            return(isAdded);
        }
Exemple #3
0
        public static clsTP_Approval SelectTP_ApprovalById(int?MDETPApprId)
        {
            clsTP_Approval objTP_Approval = new clsTP_Approval();
            bool           isnull         = true;
            string         SpName         = "usp_SelectTP_Approval";
            var            objPar         = new DynamicParameters();

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

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

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