protected void btnUpdate_Click(object sender, EventArgs e)
 {
     if (!Page.IsValid) return;
     try
     {
         if (moduleId == 0)//add new module
         {
             ModuleInfo newmodule = new ModuleInfo();
             newmodule.ModuleName = txtModuleName.Text.Trim();
             newmodule.ModuleTitle = txtModuleTitle.Text.Trim();
             newmodule.ModuleDescription = txtModuleDescription.Text.Trim();
             newmodule.ModuleFolder = txtModuleFolder.Text.Trim();
             txtID.Text = ModuleController.AddModule(newmodule).ToString();
             this.btnAddControl.Visible = true;
             this.btnDelete.Visible = true;
         }
         else//update module
         {
             module = ModuleController.GetModule(moduleId);
             if (module == null) return;
             module.ModuleName = txtModuleName.Text.Trim();
             module.ModuleTitle = txtModuleTitle.Text.Trim();
             module.ModuleDescription = txtModuleDescription.Text.Trim();
             module.ModuleFolder = txtModuleFolder.Text.Trim();
             ModuleController.UpdateModule(module);
             txtID.Text = module.ModuleID.ToString();
         }
         this.lblUpdateStatus.Text = MiscUtility.MSG_UPDATE_SUCCESS;
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
 }
Example #2
0
        public static int AddModule(ModuleInfo module)
        {
            int id = DataAccessProvider.Instance().AddModule(module);
            DataCaching data = new DataCaching();

            return id;
        }
Example #3
0
 public override void UpdateModule(ModuleInfo module)
 {
     SqlHelper.ExecuteNonQuery(this.ConnectionString, "Portal_Modules_Update", module.ModuleID, module.ModuleName, module.ModuleTitle, module.ModuleDescription, module.ModuleFolder);
 }
Example #4
0
 public override int AddModule(ModuleInfo module)
 {
     return (int)SqlHelper.ExecuteScalar(this.ConnectionString, "Portal_Modules_Insert", module.ModuleName, module.ModuleTitle, module.ModuleDescription, module.ModuleFolder);
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!CurrentUser.IsSuperAdmin) Response.Redirect(AppEnv.ADMIN_CMD);

            moduleId = ConvertUtility.ToInt32(Request.QueryString["mid"]);
            module = ModuleController.GetModule(moduleId);
            if (!Page.IsPostBack)
            {
                if (module == null)
                {
                    this.btnAddControl.Visible = false;
                    this.btnDelete.Visible = false;
                }
                this.btnDelete.Attributes.Add("onclick", MiscUtility.MSG_DELETE_CONFIRM);
            }
        }
Example #6
0
 public static void UpdateModule(ModuleInfo module)
 {
     DataAccessProvider.Instance().UpdateModule(module);
     DataCaching data = new DataCaching();
 }
 private string CheckPath(ModuleInfo module)
 {
     string temp = "/Uploads";
     if (module.ModuleFolder.Length > 0)
     {
         temp = module.ModuleFolder;
         if (temp.LastIndexOf("/") == temp.Length - 1)
             temp += "Uploads/Controls";
         else
             temp += "/Uploads/Controls";
         if (!Directory.Exists(Server.MapPath(temp)))
         {
             try
             {
                 Directory.CreateDirectory(Server.MapPath(temp));
             }
             catch (Exception ex)
             {
                 Response.Write(ex.Message);
                 return "/Uploads";
             }
         }
     }
     return temp;
 }