Example #1
0
        public void SaveServiceItem(AspxCommonInfo aspxCommonObj, int categoryId, List <ServiceItemInfo> serviceInfo)
        {
            OracleHandler     sqlH = new OracleHandler();
            OracleTransaction tran;

            tran = (OracleTransaction)sqlH.GetTransaction();
            try
            {
                AspxServiceProvider.SaveServiceItem(aspxCommonObj, categoryId, serviceInfo, tran);
                tran.Commit();
            }
            catch (Exception e)
            {
                tran.Rollback();
                throw e;
            }
        }
        public static void AddMenuPermission(List<MenuPermissionInfo> lstMenuPermissions, int MenuID, int PortalID)
        {

            OracleHandler sagesql = new OracleHandler();
            OracleTransaction tran = (OracleTransaction)sagesql.GetTransaction();

            try
            {
                string sp = "usp_MenuMgrMenuPermissionDelete";

                List<KeyValuePair<string, object>> ParaMeterColl = new List<KeyValuePair<string, object>>
                                                                      {
                                                                          new KeyValuePair<string, object>("MenuID",
                                                                                                           MenuID),
                                                                          new KeyValuePair<string, object>("PortalID",
                                                                                                           PortalID)
                                                                      };

                sagesql.ExecuteNonQuery(tran, CommandType.StoredProcedure, sp,
                                    ParaMeterColl);


                foreach (MenuPermissionInfo menu in lstMenuPermissions)
                {
                    List<KeyValuePair<string, object>> ParamCollInput = new List<KeyValuePair<string, object>>();
                    ParamCollInput.Add(new KeyValuePair<string, object>("MenuID", MenuID));
                    ParamCollInput.Add(new KeyValuePair<string, object>("PermissionID", menu.PermissionID));
                    ParamCollInput.Add(new KeyValuePair<string, object>("AllowAccess", menu.AllowAccess));
                    ParamCollInput.Add(new KeyValuePair<string, object>("RoleId", menu.RoleID == null ? Guid.Empty : new Guid(menu.RoleID)));
                    ParamCollInput.Add(new KeyValuePair<string, object>("UserName", menu.Username));
                    ParamCollInput.Add(new KeyValuePair<string, object>("PortalID", PortalID));

                    sagesql.ExecuteNonQuery(tran, CommandType.StoredProcedure, "usp_MenuMgrAddMenuPermission", ParamCollInput);
                }

                tran.Commit();
            }
            catch (Exception)
            {
                tran.Rollback();
                throw;
            }
        }
        public static void AddNewMenu(List<MenuPermissionInfo> lstMenuPermissions, string MenuName, string MenuType, bool IsDefault, int PortalID)
        {
            string sp = "usp_MenuMgrAddNewMenu";
            OracleHandler sagesql = new OracleHandler();
            int MenuID = 0;
            //SqlTransaction tran = (SqlTransaction)sagesql.GetTransaction();
            OracleTransaction tran = (OracleTransaction)sagesql.GetTransaction();
            try
            {
                List<KeyValuePair<string, object>> ParamCollInput = new List<KeyValuePair<string, object>>();

                ParamCollInput.Add(new KeyValuePair<string, object>("MenuName", MenuName));
                ParamCollInput.Add(new KeyValuePair<string, object>("MenuType", MenuType));
                ParamCollInput.Add(new KeyValuePair<string, object>("IsDefault", IsDefault));
                ParamCollInput.Add(new KeyValuePair<string, object>("PortalID", PortalID));

                MenuID = sagesql.ExecuteNonQuery(sp, ParamCollInput, "MenuID");

                foreach (MenuPermissionInfo menu in lstMenuPermissions)
                {
                    List<KeyValuePair<string, object>> ParamColl = new List<KeyValuePair<string, object>>();
                    ParamColl.Add(new KeyValuePair<string, object>("MenuID", MenuID));
                    ParamColl.Add(new KeyValuePair<string, object>("PermissionID", menu.PermissionID));
                    ParamColl.Add(new KeyValuePair<string, object>("AllowAccess", menu.AllowAccess));
                    ParamColl.Add(new KeyValuePair<string, object>("RoleId", menu.RoleID == null ? Guid.Empty : new Guid(menu.RoleID)));
                    ParamColl.Add(new KeyValuePair<string, object>("UserName", menu.Username));
                    ParamColl.Add(new KeyValuePair<string, object>("PortalID", PortalID));

                    sagesql.ExecuteNonQuery(tran, CommandType.StoredProcedure, "usp_MenuMgrAddMenuPermission", ParamColl);
                }

                tran.Commit();


            }
            catch (Exception)
            {

                throw;
            }
        }
       public static int SaveCartPricingRule(CartPricingRuleInfo objCartPriceRule, AspxCommonInfo aspxCommonObj, List<int> parentID)
       {
           OracleHandler sqlH = new OracleHandler();
           OracleTransaction tran;
           tran = (OracleTransaction)sqlH.GetTransaction();
           try
           {
               int cartPriceRuleID = -1;
               cartPriceRuleID = AspxCartPriceRuleProvider.CartPriceRuleAdd(objCartPriceRule.CartPriceRule, tran, aspxCommonObj);

               AspxCartPriceRuleProvider.RuleConditionAdd(objCartPriceRule.LstRuleCondition, cartPriceRuleID, parentID, tran, aspxCommonObj);

               foreach (CartPriceRuleRole cartPriceRuleRole in objCartPriceRule.LstCartPriceRuleRoles)
               {
                   cartPriceRuleRole.CartPriceRuleID = cartPriceRuleID;
                   AspxCartPriceRuleProvider.CartPriceRuleRoleAdd(cartPriceRuleRole, tran, aspxCommonObj);
               }

               //foreach (CartPriceRuleStore cartPriceRuleStore in objCartPriceRule.LstCartPriceRuleStores)
               //{
               //    cartPriceRuleStore.CartPriceRuleID = cartPriceRuleID;
               //    AspxCartPriceRuleProvider.CartPriceRuleStoreAdd(cartPriceRuleStore, tran, aspxCommonObj);
               //}
               tran.Commit();
               return cartPriceRuleID;
           }

           catch (OracleException sqlEX)
           {
               tran.Rollback();
               throw new ArgumentException(sqlEX.Message);
           }
           catch (Exception ex)
           {
               tran.Rollback();
               throw ex;
           }
       }
Example #5
0
        public static void UpdateUserModule(UserModuleInfo module)
        {
            //SQLHandler sqlH = new SQLHandler();
            OracleHandler     sqlH = new OracleHandler();
            OracleTransaction tran = (OracleTransaction)sqlH.GetTransaction();

            try
            {
                List <KeyValuePair <string, object> > ParaMeterCollection = new List <KeyValuePair <string, object> >
                {
                    new KeyValuePair <string, object>(
                        "UserModuleID", module.UserModuleID),
                    new KeyValuePair <string, object>(
                        "ModuleDefID", module.ModuleDefID),
                    new KeyValuePair <string, object>(
                        "UserModuleTitle", module.UserModuleTitle),
                    new KeyValuePair <string, object>(
                        "AllPages", module.AllPages),
                    new KeyValuePair <string, object>(
                        "ShowInPages", module.ShowInPages),
                    new KeyValuePair <string, object>(
                        "InheritViewPermissions", module.InheritViewPermissions),
                    new KeyValuePair <string, object>(
                        "IsActive", module.IsActive),
                    new KeyValuePair <string, object>(
                        "AddedOn", DateTime.Now),
                    new KeyValuePair <string, object>(
                        "PortalID", module.PortalID),
                    new KeyValuePair <string, object>(
                        "AddedBy", module.PortalID),
                    new KeyValuePair <string, object>(
                        "SEOName", module.SEOName),
                    new KeyValuePair <string, object>(
                        "IsHandheld", module.IsHandheld),
                    new KeyValuePair <string, object>(
                        "SuffixClass", module.SuffixClass),
                    new KeyValuePair <string, object>(
                        "HeaderText", module.HeaderText),
                    new KeyValuePair <string, object>(
                        "ShowHeaderText", module.ShowHeaderText)
                };


                sqlH.ExecuteNonQuery(tran, CommandType.StoredProcedure, "usp_UserModulesUpdate", ParaMeterCollection);
                if (module.InheritViewPermissions)
                {
                    UpdateUserModuleInheritedPermission(module.PageID, tran, module.UserModuleID, module.PortalID, module.AddedBy, module.ModuleDefID);
                }
                else
                {
                    UpdateUserModulePermission(module.LSTUserModulePermission, tran, module.UserModuleID, module.PortalID, module.AddedBy, module.ModuleDefID);
                }


                tran.Commit();
            }
            catch (OracleException sqlEx)
            {
                tran.Rollback();
                throw sqlEx;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }