protected void Add_Click(object sender, EventArgs e) { TextBox name = (TextBox)DetailsView_Documents.FindControl("name"); DropDownList countrydp = (DropDownList)DetailsView_Documents.FindControl("countrydp"); CKEditorControl des = (CKEditorControl)DetailsView_Documents.FindControl("destxt"); bool result = false; switch (Session["Admin_Type"].ToString()) { case "USER": result = ClientAdmin.Utility.Grid_DocumentsAdd(name.Text, Convert.ToInt32(countrydp.SelectedValue.ToString()), des.Text, Session["Admin_Customer"].ToString()); break; case "ADMIN": result = MasterAdmin.Utility.Grid_DocumentsAdd(name.Text, Convert.ToInt32(countrydp.SelectedValue.ToString()), des.Text, Session["Admin_Customer"].ToString()); break; default: Response.Redirect("~/Fail.aspx"); break; } if (result == true) { Response.Redirect("~/secure/Documents/Browse_Documents.aspx?search=&t1=0"); } }
protected void DetailsView_Documents_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { switch (Session["Admin_Type"].ToString()) { case "USER": ClientAdmin.Utility.Grid_DocumentsSelect(DetailsView_Documents, Convert.ToInt32(Session["document_id"].ToString()), Session["Admin_Customer"].ToString(), Session["des_role"].ToString()); break; case "ADMIN": MasterAdmin.Utility.Grid_DocumentsSelect(DetailsView_Documents, Convert.ToInt32(Session["document_id"].ToString()), Session["des_role"].ToString()); HtmlGenericControl tab = (HtmlGenericControl)DetailsView_Documents.FindControl("extratab"); tab.Visible = false; load_grid(); break; default: Response.Redirect("~/Fail.aspx"); break; } DropDownList country = (DropDownList)DetailsView_Documents.FindControl("Countrydp"); Label temp = (Label)DetailsView_Documents.FindControl("temp"); country.SelectedValue = temp.Text; } }
protected void Swap_Click(object sender, EventArgs e) { CKEditorControl countrydes = (CKEditorControl)DetailsView_Documents.FindControl("destxt"); HtmlGenericControl masterdesc = (HtmlGenericControl)DetailsView_Documents.FindControl("masterdesc"); countrydes.Text = masterdesc.InnerHtml; }
protected void AdminLoad() { MasterAdmin.Utility.Grid_DocumentsSelect(DetailsView_Documents, Convert.ToInt32(Session["document_id"].ToString()), Session["des_role"].ToString()); HtmlGenericControl tab = (HtmlGenericControl)DetailsView_Documents.FindControl("extratab"); tab.Visible = false; load_grid(); DropDownList country = (DropDownList)DetailsView_Documents.FindControl("Countrydp"); MasterAdmin.Utility.Getcountry(country, Session["Customer_id"].ToString()); Label temp = (Label)DetailsView_Documents.FindControl("temp"); country.SelectedValue = temp.Text; }
protected void Countrydp_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DropDownList countrydp = (DropDownList)DetailsView_Documents.FindControl("countrydp"); switch (Session["Admin_Type"].ToString()) { case "USER": ClientAdmin.Utility.Getcountry(countrydp, Session["Admin_Customer"].ToString()); break; case "ADMIN": MasterAdmin.Utility.Getcountry(countrydp, Session["Customer_id"].ToString()); break; default: Response.Redirect("~/Fail.aspx"); break; } } }
protected void load_grid() { if (Request.QueryString["did"] != null) { DataTable dtCollection = new DataTable(); dtCollection.Rows.Clear(); dtCollection.Columns.Clear(); dtCollection.Columns.Add("Vfile"); dtCollection.Columns.Add("Path"); dtCollection.Columns.Add("File"); string filename = Request.QueryString["did"].ToString() + ".pdf"; string path = "~/Assets/Documents/" + filename; if (File.Exists(Server.MapPath(path))) { Label lblfilename = (Label)DetailsView_Documents.FindControl("lblfilename"); string virtualfilename = lblfilename.Text; PersistRowIndex(filename, virtualfilename, Request.QueryString["did"].ToString(), dtCollection); } Doc_grid.DataBind(); } }