protected void btnDelete_Click(object sender, EventArgs e) { try { mainPanel.Enabled = false; System.Threading.Thread.Sleep(2000); mainPanel.Enabled = true; foreach (GridViewRow item in GridInboxdetails.Rows) { chk = (CheckBox)item.FindControl("chk1"); if (chk.Checked) { Label id = (Label)item.FindControl("lblid"); Cls_EmailMaster.UpdateEmailDeleteStatusInbox(Convert.ToInt32(id.Text)); Getdata(); lblMsg.Text = ""; lblMsg.Visible = false; } else { //lblMsg.Text = "Please Atleast One record is delete.."; lblMsg.Visible = true; } } } catch (Exception ex) { lblMsg.Text = ex.Message; } }
protected void rdbMembers_CheckedChanged(object sender, EventArgs e) { try { DataSet ds = Cls_EmailMaster.ShowAdminEmails(); if (ds.Tables[0].Rows.Count != 0) { ddlto.DataSource = ds.Tables[0]; ddlto.DataTextField = "Username"; ddlto.DataValueField = "Vole_mem_id"; ddlto.DataBind(); ddlto.Items.Insert(0, "--Select Emailid--"); } else { ddlto.Items.Clear(); ddlto.Items.Insert(0, "--Select Emailid--"); } txtbody.Text = ""; txtsubject.Text = ""; lblMsg.Text = ""; } catch (Exception ex) { lblMsg.Text = ex.Message; } }
protected void GridInboxdetails_RowCommand(object sender, GridViewCommandEventArgs e) { try { DataSet ds = Cls_EmailMaster.ShowEmailDetailsidwiseOutbox(Convert.ToInt32(e.CommandArgument)); if (ds.Tables[0].Rows.Count != 0) { byte[] FileContent = (byte[])ds.Tables[0].Rows[0][5]; string FileName = (string)ds.Tables[0].Rows[0][6]; string[] fileSplit = FileName.Split('.'); int Loc = fileSplit.Length; string FileExtention = "." + fileSplit[Loc - 1].ToUpper(); int i = 0; if (FileExtention == ".DOC" || FileExtention == ".DOCX") { Response.ContentType = "application/vnd.ms-word"; Response.AddHeader("content-disposition", "inline;filename=" + FileName); i = 1; } else if (FileExtention == ".XL" || FileExtention == ".XLS" || FileExtention == ".XLSX") { Response.ContentType = "application/vnd.ms-excel"; Response.AddHeader("content-disposition", "inline;filename=" + FileName); i = 1; } else if (FileExtention == ".PDF") { Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "inline;filename=" + FileName); i = 1; } else if (FileExtention == ".TXT") { Response.ContentType = "application/octet-stream"; Response.AddHeader("content-disposition", "inline;filename=" + FileName); i = 1; } if (i == 1) { Response.Charset = ""; Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.BinaryWrite(FileContent); Response.End(); } else { lblMsg.Text = "Problom in downloading the file.."; } } } catch (Exception ex) { lblMsg.Text = ex.Message; } }
public void Getdata() { try { GridInboxdetails.DataSource = Cls_EmailMaster.ShowInboxdetails(Convert.ToInt32(Session["MemberId"])); GridInboxdetails.DataBind(); lblMsg.Text = ""; } catch (Exception ex) { lblMsg.Text = ex.Message; } }
public void GetFacultyMailId() { DataSet dsOfficerMails = Cls_EmailMaster.ShowOfficerEmails(); if (dsOfficerMails.Tables[0].Rows.Count > 0) { ddlOfficerMailId.DataTextField = "UserName"; ddlOfficerMailId.DataValueField = "Std_Agr_Id"; ddlOfficerMailId.DataSource = dsOfficerMails.Tables[0]; ddlOfficerMailId.DataBind(); ddlOfficerMailId.Items.Insert(0, "Select Valid Officer MailId"); } }
public void GetStudentMailId() { DataSet dsStudentMails = Cls_EmailMaster.ShowStudentEmails(); if (dsStudentMails.Tables[0].Rows.Count > 0) { ddlStudentMailId.DataTextField = "UserName"; ddlStudentMailId.DataValueField = "Std_Agr_Id"; ddlStudentMailId.DataSource = dsStudentMails.Tables[0]; ddlStudentMailId.DataBind(); ddlStudentMailId.Items.Insert(0, "Select Valid Student MailId"); } }
protected void Page_Load(object sender, EventArgs e) { try { DataSet ds = Cls_EmailMaster.ShowEmailDetailsidwiseOutbox(Convert.ToInt32(Request["id"])); if (ds.Tables[0].Rows.Count != 0) { GridInboxdetails.DataSource = ds.Tables[0]; GridInboxdetails.DataBind(); } } catch (Exception ex) { lblMsg.Text = ex.Message; } }