Exemple #1
0
        public void SaveOrUpdateModule()
        {
            PocModule module = CurrentPocModule;

            module.Name       = View.GetName;
            module.FolderPath = View.GetFolderPath;
            _controller.SaveOrUpdateEntity <PocModule>(module);
        }
Exemple #2
0
        private void BindControls()
        {
            PocModule module = _presenter.CurrentPocModule;

            this.txtName.Text       = module.Name;
            this.txtFolderPath.Text = module.FolderPath;
            this.btnDelete.Visible  = (module.Id > 0);
            this.btnDelete.Attributes.Add("onclick", "return confirm(\"Are you sure?\")");
        }
Exemple #3
0
        public void Delete(PocModule mod)
        {
            string sql = "Delete PocModule where ModuleId = @ModId";

            using (SqlCommand cm = new SqlCommand(sql, DefaultConnection))
            {
                DatabaseHelper.InsertInt32Param("@ModId", cm, mod.Id);
                cm.ExecuteNonQuery();
            }
        }
Exemple #4
0
        public void Update(PocModule mod, SqlTransaction sqltransaction)
        {
            string sql = "UPDATE PocModule  SET [Name] = @Name,  [FolderPath] = @FolderPath WHERE ModuleId = @ModId";

            using (SqlCommand cm = new SqlCommand(sql, DefaultConnection, sqltransaction))
            {
                DatabaseHelper.InsertInt32Param("@ModId", cm, mod.Id);
                SetModule(cm, mod);
                cm.ExecuteNonQuery();
            }
        }
Exemple #5
0
        public void Save(PocModule mod, SqlTransaction sqltransaction)
        {
            string sql = "INSERT INTO PocModule([Name], [FolderPath]) "
                         + "VALUES(@Name,  @FolderPath)  SELECT @@identity";

            using (SqlCommand cm = new SqlCommand(sql, DefaultConnection, sqltransaction))
            {
                SetModule(cm, mod);
                mod.Id = int.Parse(cm.ExecuteScalar().ToString());
            }
        }
Exemple #6
0
        protected void grvNodes_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
        {
            PocModule mod = e.Row.DataItem as PocModule;

            if (mod != null)
            {
                HyperLink hpl = e.Row.FindControl("hplEdit") as HyperLink;
                string    url = String.Format("~/Admin/ModuleEdit.aspx?{0}=0&{1}={2}", AppConstants.TABID, AppConstants.MODULEID, mod.Id);

                hpl.NavigateUrl = this.ResolveUrl(url);
            }
        }
Exemple #7
0
        private string GetVirtualPath()
        {
            PocModule m = _presenter.GetModuleById(int.Parse(ddlModule.SelectedValue));

            return("~/" + m.FolderPath + "/" + txtFolderpath.Text);
        }
Exemple #8
0
 private static void SetModule(SqlCommand cm, PocModule mod)
 {
     DatabaseHelper.InsertStringNVarCharParam("@Name", cm, mod.Name);
     DatabaseHelper.InsertStringNVarCharParam("@FolderPath", cm, mod.FolderPath);
 }