public void SaveOrUpdateModule() { PocModule module = CurrentPocModule; module.Name = View.GetName; module.FolderPath = View.GetFolderPath; _controller.SaveOrUpdateEntity <PocModule>(module); }
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?\")"); }
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(); } }
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(); } }
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()); } }
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); } }
private string GetVirtualPath() { PocModule m = _presenter.GetModuleById(int.Parse(ddlModule.SelectedValue)); return("~/" + m.FolderPath + "/" + txtFolderpath.Text); }
private static void SetModule(SqlCommand cm, PocModule mod) { DatabaseHelper.InsertStringNVarCharParam("@Name", cm, mod.Name); DatabaseHelper.InsertStringNVarCharParam("@FolderPath", cm, mod.FolderPath); }