protected void drlCampaign_SelectedIndexChanged(object sender, EventArgs e) { int readMail = 0; try { srBUS = new SendRegisterBUS(); srdBus = new SendRegisterDetailBUS(); sendContentBus = new SendContentBUS(); mgBus = new MailGroupBUS(); int sendId = int.Parse(drlCampaign.SelectedValue.ToString()); DataTable campain = srdBus.GetByID(sendId); DataTable errSend = srdBus.GetByStatus(false, sendId); DataTable unreceve = srdBus.GetByNotReceve(sendId); int err = errSend.Rows.Count; this.lblTotalMailSend.Text = campain.Rows.Count.ToString(); int notreceve = unreceve.Rows.Count; lblEmailSend.Text = new MailConfigBUS().GetByID(int.Parse(srBUS.GetByID(sendId).Rows[0]["mailconfigid"]+"")).Rows[0]["eMail"].ToString(); if (campain.Rows.Count > 0) { foreach (DataRow row in campain.Rows) { if (row["isOpenMail"].ToString() == "True") { readMail++; } } lblNotOpen2.Text = (campain.Rows.Count - readMail).ToString(); } lblNotOpen2.Text = "0"; lblOpened.Text = readMail.ToString(); DataTable sendregisteDetail = srBUS.GetByID(sendId); if (sendregisteDetail.Rows.Count > 0) { int contentID = int.Parse(sendregisteDetail.Rows[0]["SendContentId"].ToString()); lblDateStart.Text = sendregisteDetail.Rows[0]["StartDate"].ToString(); lblDateEnd.Text = sendregisteDetail.Rows[0]["EndDate"].ToString(); int groupSend = int.Parse(sendregisteDetail.Rows[0]["GroupTo"].ToString()); if (groupSend == -3) lblGroupEmailTo.Text = "Tất cả"; else lblGroupEmailTo.Text = mgBus.GetByID(groupSend).Rows[0]["Name"].ToString(); if (sendContentBus.GetByID(contentID).Rows.Count > 0) { lblCampianName.Text = sendContentBus.GetByID(contentID).Rows[0]["Subject"].ToString(); } } if (campain.Rows.Count > 0) CreateChart(campain.Rows.Count, err, readMail, 1, notreceve, lblCampianName.Text); else lblChart.Text = ""; LoadOpenEmail(sendId); } catch (Exception ex) { //pnError.Visible = true; //lblError.Text = ex.Message; } }
protected string LoadChart(object id) { int readMail = 0; try { //int i=0; for (int i = 0; i < dlContentSendEvent.Items.Count; i++) { HiddenField hdfId = (HiddenField)dlContentSendEvent.Items[i].FindControl("hdfId"); if (hdfId.Value + "" == id + "") { SendRegisterBUS srBUS = new SendRegisterBUS(); SendRegisterDetailBUS srdBus = new SendRegisterDetailBUS(); SendContentBUS sendContentBus = new SendContentBUS(); MailGroupBUS mgBus = new MailGroupBUS(); int sendId = int.Parse(id + ""); DataTable campain = srdBus.GetByContentID(sendId); DataTable errSend = srdBus.GetContentSendEventDetailByStatus(false, sendId); DataTable unreceve = srdBus.GetByNotReceve(sendId); int err = errSend.Rows.Count; Label lblTotalMailSend = (Label)dlContentSendEvent.Items[i].FindControl("lblTotalMailSend"); Label lblEmailSend = (Label)dlContentSendEvent.Items[i].FindControl("lblEmailSend"); Label lblNotOpen2 = (Label)dlContentSendEvent.Items[i].FindControl("lblNotOpen2"); Label lblOpened = (Label)dlContentSendEvent.Items[i].FindControl("lblOpened"); Label lblDateStart = (Label)dlContentSendEvent.Items[i].FindControl("lblDateStart"); Label lblDateEnd = (Label)dlContentSendEvent.Items[i].FindControl("lblDateEnd"); Label lblGroupEmailTo = (Label)dlContentSendEvent.Items[i].FindControl("lblGroupEmailTo"); Label lblCampianName = (Label)dlContentSendEvent.Items[i].FindControl("lblCampianName"); Label lblChart = (Label)dlContentSendEvent.Items[i].FindControl("lblChart"); lblTotalMailSend.Text = campain.Rows.Count.ToString(); int notreceve = unreceve.Rows.Count; if (campain.Rows.Count > 0) { lblEmailSend.Text = campain.Rows[0]["MailSend"].ToString(); foreach (DataRow row in campain.Rows) { if (row["isOpenMail"].ToString() == "True") { readMail++; } } lblNotOpen2.Text = (campain.Rows.Count - readMail).ToString(); } lblOpened.Text = readMail.ToString(); DataTable sendregisteDetail = cseBus.GetById(sendId); if (sendregisteDetail.Rows.Count > 0) { int contentID = int.Parse(sendregisteDetail.Rows[0]["id"].ToString()); //lblDateStart.Text = sendregisteDetail.Rows[0]["StartDate"].ToString(); //lblDateEnd.Text = sendregisteDetail.Rows[0]["EndDate"].ToString(); int groupSend = int.Parse(sendregisteDetail.Rows[0]["GroupTo"].ToString()); if (groupSend == -3) lblGroupEmailTo.Text = "Tất cả"; else lblGroupEmailTo.Text = mgBus.GetByID(groupSend).Rows[0]["Name"].ToString(); if (sendContentBus.GetByID(contentID).Rows.Count > 0) { lblCampianName.Text = sendContentBus.GetByID(contentID).Rows[0]["Subject"].ToString(); } } CreateChart(campain.Rows.Count, err, readMail, 1, notreceve, lblCampianName.Text, lblChart); } } } catch (Exception ex) { pnError.Visible = true; lblError.Text = ex.Message; } return ""; }