protected void Load_Current_Schedules() { string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString()); string sortdirection = (ViewState["SORTDIRECTION"] == null) ? "" : (ViewState["SORTDIRECTION"].ToString() == "1") ? " ASC" : " DESC"; string Sort_Expression = sortbycoloumn + sortbycoloumn; int Frequency_Type = UDFLib.ConvertToInteger(ddlFrequencyType.SelectedValue); int Last_Run_Success = -1; int Status = -1; string SearchText = txtSearchText.Text; int ShowDept = 0; if (chkOnlyDept.Checked) { ShowDept = 1; } //int DeptId = Convert.ToInt32(Session["USERDEPARTMENTID"]); int DeptId = UDFLib.ConvertToInteger(Session["USERDEPARTMENTID"]); int is_Fetch_Count = ucCustomPagerAllStatus.isCountRecord; DataSet ds = BLL_Infra_DaemonSettings.Get_Current_Schedules(Frequency_Type, Last_Run_Success, Status, SearchText, GetSessionUserID(), ShowDept, DeptId, Convert.ToInt32(ViewState["IsAdmin"]), ucCustomPagerAllStatus.CurrentPageIndex, ucCustomPagerAllStatus.PageSize, ref is_Fetch_Count); grdSchedules.DataSource = ds.Tables[0]; grdSchedules.DataBind(); ucCustomPagerAllStatus.CountTotalRec = is_Fetch_Count.ToString(); ucCustomPagerAllStatus.BuildPager(); }
protected void ddlSavedQuery_SelectedIndexChanged(object sender, EventArgs e) { if (ddlSavedQuery.SelectedValue == "0") { txtQuery.Text = ""; txtQueryName.Text = ""; lblQueryDetails.Text = ""; lblCreatedBy.Text = ""; } else { DataTable dt = BLL_Infra_DaemonSettings.Get_SavedQuery(UDFLib.ConvertToInteger(ddlSavedQuery.SelectedValue), GetSessionUserID()); if (dt.Rows.Count > 0) { txtQuery.Text = dt.Rows[0]["Command_SQL"].ToString(); txtQueryName.Text = dt.Rows[0]["Query_Name"].ToString(); lblQueryDetails.Text = "Server: " + dt.Rows[0]["DBServer"].ToString() + "/ (" + dt.Rows[0]["DatabaseName"].ToString() + ")" + "<br>Query Name: " + dt.Rows[0]["Query_Name"].ToString(); lblCreatedBy.Text = "Created By: " + dt.Rows[0]["CreatedBy"].ToString() + " on " + dt.Rows[0]["Date_Of_Creation"].ToString(); if (dt.Rows[0]["ModifiedBy"].ToString() != "") { lblCreatedBy.Text += ", Modified By: " + dt.Rows[0]["ModifiedBy"].ToString() + " on " + dt.Rows[0]["Date_Of_Modification"].ToString(); } } else { txtQuery.Text = ""; txtQueryName.Text = ""; lblQueryDetails.Text = ""; lblCreatedBy.Text = ""; } } }
protected void btnOpenReport_Click(object sender, EventArgs e) { Save_Schedule(); Load_Current_Schedules(); if (ViewState["ScheduleID"] == null) { string js = "ald()"; ScriptManager.RegisterStartupScript(this, this.GetType(), "ValidateAllJS", js, true); UpdatePanel_Routine.UpdateMode = UpdatePanelUpdateMode.Conditional; UpdatePanel_Routine.Update(); return; } DataTable dt = BLL_Infra_DaemonSettings.Generate_Report(Convert.ToInt32(ViewState["ScheduleID"])); string htmlString = dt.Rows[0].ItemArray[0].ToString(); string filepath = Server.MapPath("~/Uploads/Temp/"); string filename = "WorkListReport" + DateTime.Now.Day + DateTime.Now.Month + DateTime.Now.Second + DateTime.Now.Millisecond + ".pdf"; string filenamewithpath = filepath + filename; EO.Pdf.HtmlToPdf.ConvertHtml(htmlString, filenamewithpath); ResponseHelper.Redirect("~/Uploads/Temp/" + filename, "blank", ""); }
protected void Run_Schedule(int ScheduleID) { int Res = BLL_Infra_DaemonSettings.Run_Schedule(ScheduleID, GetSessionUserID()); if (Res > 0) { Load_Current_Schedules(); } }
protected void Load_SavedProcedures() { DataTable dt = BLL_Infra_DaemonSettings.Get_DatabaseProcedures(); ddlSavedQuery.DataSource = dt; ddlSavedQuery.DataTextField = "ObjectName"; ddlSavedQuery.DataValueField = "ObjectName"; ddlSavedQuery.DataBind(); ddlSavedQuery.Items.Insert(0, new ListItem("Select Procedure", "0")); }
protected void Load_SavedQueries() { DataTable dt = BLL_Infra_DaemonSettings.Get_SavedQuery(hdnServer.Value, hdnCatalog.Value, hdnUsername.Value, 0, GetSessionUserID()); ddlSavedQuery.Items.Clear(); ddlSavedQuery.DataSource = dt; ddlSavedQuery.DataTextField = "Query_Name"; ddlSavedQuery.DataValueField = "ID"; ddlSavedQuery.DataBind(); ddlSavedQuery.Items.Insert(0, new ListItem("Select Procedure", "0")); }
protected void Load_DatabaseProcedures() { DataTable dt = BLL_Infra_DaemonSettings.Get_DatabaseProcedures(); lstDBProcedures.Items.Clear(); lstDBProcedures.DataSource = dt; lstDBProcedures.DataTextField = "objectname"; lstDBProcedures.DataValueField = "objectname"; lstDBProcedures.DataBind(); lstDBProcedures.Items.Insert(0, new ListItem("Select Procedure", "0")); }
protected void btnSaveCommand_Click(object sender, EventArgs e) { string DBServer = ddlServer.SelectedValue; string Catalog = ddlCatalog.SelectedValue; int Res = BLL_Infra_DaemonSettings.SaveQuery(txtQueryName.Text, ddlCommandType.SelectedValue, txtQuery.Text, ddlResultType.SelectedValue, DBServer, Catalog, txtLogin.Text, hdnPassword.Value, UDFLib.ConvertToInteger(Session["USERID"])); if (Res > 0) { string js = "alert('Query Saved !!'); hideModal('dvSaveCommand');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "script2", js, true); } }
protected void lstDBProcedures_SelectedIndexChanged(object sender, EventArgs e) { txtQuery.Text = ""; txtQueryName.Text = ""; lblQueryDetails.Text = ""; lblCreatedBy.Text = ""; DataTable dt = BLL_Infra_DaemonSettings.Get_DatabaseProcedureSQL(ddlSavedQuery.SelectedValue); if (dt.Rows.Count > 0) { txtQuery.Text = dt.Rows[0]["sqlcommand"].ToString(); } }
protected void btnPreview_Click(object sender, EventArgs e) { try { if (txtQuery.Text != "") { DataTable dt = BLL_Infra_DaemonSettings.ExecuteQuery(GetConnectionString(), txtQuery.Text, 0); gvResult.DataSource = dt; gvResult.DataBind(); } } catch (Exception ex) { string js = "alert('" + ex.Message.Replace("'", "") + "');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "script1", js, true); } }
protected bool Save_Schedule() { try { if (ValidateAll() == true) { DataTable dtSchedule = NewDaemonScheduleTable(); DataTable dtSettings = NewDaemonSettingTable(); Populate_Schedular_Table(dtSchedule); Populate_Settings_Table(dtSettings); int Res = BLL_Infra_DaemonSettings.Save_Schedule(dtSchedule, dtSettings, GetSessionUserID()); if (Res == -1) { string js = "alert('Schedule name already exists.');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "script1", js, true); return(false); } else if (Res > 0) { ViewState["ScheduleID"] = Res.ToString(); return(true); } else { return(false); } } else { return(false); } } catch (Exception ex) { string js = "alert('" + ex.Message.Replace("'", "") + "');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "script1", js, true); return(false); } }
protected void GetSelectedSuppliers(int ScheduleID) { if (chkSuppliers.Checked == true) { DataTable dt = BLL_Infra_DaemonSettings.GetSelectedSuppliers(ScheduleID); if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { for (int i = 1; i < chklstSuppliers.Items.Count; i++) { if (row["SUPPLIER"].ToString() == chklstSuppliers.Items[i].Value) { chklstSuppliers.Items[i].Selected = true; break; } } } } } }
protected void btnPOReport_Click(object sender, EventArgs e) { Save_Schedule(); Load_Current_Schedules(); if (ViewState["ScheduleID"] == null) { string js = "ald()"; ScriptManager.RegisterStartupScript(this, this.GetType(), "ValidateAllJS", js, true); UpdatePanel_Routine.UpdateMode = UpdatePanelUpdateMode.Conditional; UpdatePanel_Routine.Update(); return; } DataTable dt = BLL_Infra_DaemonSettings.Generate_PO_Report(Convert.ToInt32(ViewState["ScheduleID"])); string htmlString = dt.Rows[0].ItemArray[0].ToString(); System.IO.StreamWriter excelDoc; excelDoc = new System.IO.StreamWriter(System.IO.Path.Combine(Server.MapPath("~") + @"\" + "Uploads/Purchase/", "POReport_" + DateTime.Now.Day + "-" + DateTime.Now.Month + "-" + DateTime.Now.Year + "_" + DateTime.Now.Hour + "h" + DateTime.Now.Minute + "m" + DateTime.Now.Second + "s" + ".xls")); excelDoc.Write(htmlString); excelDoc.Close(); excelDoc.Dispose(); ResponseHelper.Redirect("~/Uploads/Purchase/" + "POReport_" + DateTime.Now.Day + "-" + DateTime.Now.Month + "-" + DateTime.Now.Year + "_" + DateTime.Now.Hour + "h" + DateTime.Now.Minute + "m" + DateTime.Now.Second + "s" + ".xls", "blank", ""); }
protected void Load_Schedule(int ScheduleID) { ViewState["ScheduleID"] = ScheduleID; int Me = 0; DataSet ds = BLL_Infra_DaemonSettings.Get_Schedule_Details(ScheduleID, GetSessionUserID()); DataTable dtSchedule = ds.Tables[0]; DataTable dtSettings = ds.Tables[1]; if (dtSchedule.Rows.Count > 0) { ViewState["ScheduleID"] = dtSchedule.Rows[0]["ScheduleID"].ToString(); txtScheduleName.Text = dtSchedule.Rows[0]["Schedule_Name"].ToString(); txtDesc.Text = dtSchedule.Rows[0]["Schedule_Desc"].ToString(); txtStartDate.Text = dtSchedule.Rows[0]["Start_Date"].ToString(); txtEndDate.Text = dtSchedule.Rows[0]["End_Date"].ToString(); rdoFrequency.SelectedValue = dtSchedule.Rows[0]["FrequencyType"].ToString(); txtDaily.Text = dtSchedule.Rows[0]["Frequency"].ToString(); txtWeek.Text = dtSchedule.Rows[0]["Frequency"].ToString(); rdoFrequency_SelectedIndexChanged(null, null); rdoRoutineType.SelectedValue = dtSchedule.Rows[0]["RoutineType"].ToString(); if (Convert.ToInt32(dtSchedule.Rows[0]["SubRoutineType"]) > 0) { try { rdoSubRoutineType.SelectedValue = dtSchedule.Rows[0]["SubRoutineType"].ToString(); } catch (Exception ex) { rdoSubRoutineType.SelectedIndex = -1; } } else { rdoSubRoutineType.SelectedIndex = -1; } rdoRoutineType_SelectedIndexChanged(null, null); } if (dtSettings.Rows.Count > 0) { txtMailTo.Text = GetSettingString(dtSettings, "MailTo", ""); txtMailCC.Text = GetSettingString(dtSettings, "MailCC", ""); txtSubject.Text = GetSettingString(dtSettings, "Subject", ""); txtMailHeader.Text = GetSettingString(dtSettings, "MailHeader", ""); txtMailFooter.Text = GetSettingString(dtSettings, "MailFooter", ""); txtRoutineMethod.Text = GetSettingString(dtSettings, "SYSTEMPROCEDURE", "").ToString(); if (GetSettingValue(dtSettings, "SYSALERT", 0) == 1) { chkSysAlert.Checked = true; } else { chkSysAlert.Checked = false; } ddlSavedQuery.SelectedValue = GetSettingString(dtSettings, "DataProcedure", "0"); if (rdoFrequency.SelectedValue == "1") { int DAILY_OCCURANCE_TYPE = GetSettingValue(dtSettings, "DAILY OCCURANCE TYPE", 1); if (DAILY_OCCURANCE_TYPE == 1) { rdoDailyFrequency.SelectedValue = "1"; ddlDailyOccursAt_H.SelectedValue = GetSettingValue(dtSettings, "DAILY ONCE HOUR", 0).ToString(); ddlDailyOccursAt_M.SelectedValue = GetSettingValue(dtSettings, "DAILY ONCE MINUTE", 0).ToString(); } if (DAILY_OCCURANCE_TYPE == 2) { rdoDailyFrequency.SelectedValue = "2"; txtDailyOccursValue.Text = GetSettingValue(dtSettings, "DAILY REPEAT VALUE", 0).ToString(); ddlDailyOccursType.SelectedValue = GetSettingValue(dtSettings, "DAILY REPEAT TYPE", 0).ToString(); } } if (rdoFrequency.SelectedValue == "2") { DataTable dtWeekdays = GetSettingTable(dtSettings, "WEEKDAYS"); chkWeekDays.ClearSelection(); foreach (DataRow dr in dtWeekdays.Rows) { chkWeekDays.Items[UDFLib.ConvertToInteger(dr["key_value_int"]) - 1].Selected = true; } } if (dtSchedule.Rows[0]["RoutineType"].ToString() == "3") { if (GetSettingValue(dtSettings, "JOBCREATEDINDAYS", 0) == 0) { txtJCDFrom.Text = GetSettingDateValue(dtSettings, "JOBCREATEDFROM", ""); txtJCDTo.Text = GetSettingDateValue(dtSettings, "JOBCREATEDTO", ""); rdbJobCreatedBetween.Checked = true; } else { rdbJObCreatedLast.Checked = true; ddlJobCL.SelectedValue = GetSettingValue(dtSettings, "JOBCREATEDINDAYS", 0).ToString(); } chkShowAllPending.Checked = Convert.ToBoolean(GetSettingValue(dtSettings, "SHOWALLPENDINGJOBS", 0)); chkJobCompletedIn.Checked = Convert.ToBoolean(GetSettingValue(dtSettings, "SHOWJOBCOMPLETED", 0)); ddlJobCompletdIn.SelectedValue = GetSettingValue(dtSettings, "SHOWJOBCOMPLETEDINDAYS", 0).ToString(); string ncrcheck = GetSettingString(dtSettings, "JOBTYPE", "");; try { rdbJObType.SelectedValue = ncrcheck; } catch (Exception) { rdbJObType.SelectedIndex = 0; } chkPMS.Checked = Convert.ToBoolean(GetSettingValue(dtSettings, "PMSJOB", 0)); ddlPMS.SelectedValue = GetSettingString(dtSettings, "PMSJOBINDAYS", ""); ddlReportBy.SelectedValue = GetSettingString(dtSettings, "SENDBY", ""); // ddlJobCL.SelectedValue = GetSettingValue(dtSettings, "JOBCREATEDINDAYS", 0).ToString(); Me = GetSettingValue(dtSettings, "SAVEPREFFORME", 0); if (Me != 0) { ddlPrefFor.SelectedValue = "ME"; } else { ddlPrefFor.SelectedValue = "MYDEPARTMENT"; } } if (dtSchedule.Rows[0]["RoutineType"].ToString() == "4") { if (GetSettingValue(dtSettings, "POCREATEDINDAYS", 0) == 0) { txtPOFrom.Text = GetSettingDateValue(dtSettings, "POCREATEDFROM", ""); txtPOTo.Text = GetSettingDateValue(dtSettings, "POCREATEDTO", ""); rdoPOCreationBetween.Checked = true; rdoPOCreationLast.Checked = false; } else { rdoPOCreationBetween.Checked = false; rdoPOCreationLast.Checked = true; ddlPOCreatedLast.SelectedValue = GetSettingValue(dtSettings, "POCREATEDINDAYS", 0).ToString(); } chkSuppliers.Checked = Convert.ToBoolean(GetSettingValue(dtSettings, "SELECTEDSUPPLIER", 0)); BindSuppliersList(); if (Convert.ToBoolean(GetSettingValue(dtSettings, "SELECTEDSUPPLIER", 0)) == true) { GetSelectedSuppliers(ScheduleID); chklstSuppliers.Enabled = true; } else { chklstSuppliers.Enabled = false; } Me = GetSettingValue(dtSettings, "SAVEPREFFORME", 0); if (Me != 0) { ddlPOPrefrences.SelectedValue = "ME"; } else { ddlPOPrefrences.SelectedValue = "MYDEPARTMENT"; } } } if (Session["USERID"].ToString() != dtSchedule.Rows[0]["Created_By"].ToString()) { ddlPrefFor.Enabled = false; } if (Convert.ToInt32(ViewState["IsAdmin"]) == 0) { if (ddlPrefFor.SelectedValue != "MYDEPARTMENT") { if (Session["USERID"].ToString() != dtSchedule.Rows[0]["Created_By"].ToString()) { btnSaveSchedule.Enabled = false; btnSaveScheduleAndClose.Enabled = false; } } } string js = "showModal('dvWizardDialog');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "hideModalJS", js, true); }
protected void Populate_Settings_Table(DataTable dtSettings) { int ScheduleID = UDFLib.ConvertToInteger(ViewState["ScheduleID"]); if (chkSysAlert.Visible) { if (chkSysAlert.Checked) { dtSettings.Rows.Add(ScheduleID, "SYSALERT", null, null, 1); } else { dtSettings.Rows.Add(ScheduleID, "SYSALERT", null, null, 0); } } else { dtSettings.Rows.Add(ScheduleID, "SYSALERT", null, null, 0); } switch (rdoFrequency.SelectedValue) { case "1": // DAILY dtSettings.Rows.Add(ScheduleID, "DAILY OCCURANCE TYPE", "Occurs once OR repetedly", null, rdoDailyFrequency.SelectedValue); if (rdoDailyFrequency.SelectedValue == "1") { dtSettings.Rows.Add(ScheduleID, "DAILY ONCE HOUR", "Occurs once at this hour", null, ddlDailyOccursAt_H.SelectedValue); dtSettings.Rows.Add(ScheduleID, "DAILY ONCE MINUTE", "Occurs once at this minute", null, ddlDailyOccursAt_M.SelectedValue); } else { dtSettings.Rows.Add(ScheduleID, "DAILY REPEAT VALUE", "Occurs Every", null, UDFLib.ConvertToInteger(txtDailyOccursValue.Text)); dtSettings.Rows.Add(ScheduleID, "DAILY REPEAT TYPE", "Occurs Every H/M/S", null, ddlDailyOccursType.SelectedValue); } break; case "2": // Weekly foreach (ListItem li in chkWeekDays.Items) { if (li.Selected == true) { dtSettings.Rows.Add(ScheduleID, "WEEKDAYS", li.Text, null, li.Value); } } break; } switch (rdoRoutineType.SelectedValue) { case "1": // Database Routine switch (rdoSubRoutineType.SelectedValue) { case "1": //Send Mail Tabular Data dtSettings.Rows.Add(ScheduleID, "MAILTO", txtMailTo.Text); dtSettings.Rows.Add(ScheduleID, "MAILCC", txtMailCC.Text); dtSettings.Rows.Add(ScheduleID, "SUBJECT", txtSubject.Text); dtSettings.Rows.Add(ScheduleID, "MAILHEADER", txtMailHeader.Text); dtSettings.Rows.Add(ScheduleID, "MAILFOOTER", txtMailFooter.Text); dtSettings.Rows.Add(ScheduleID, "DATAPROCEDURE", ddlSavedQuery.SelectedValue); break; } break; case "2": // System Routine switch (rdoSubRoutineType.SelectedValue) { case "1": //Send Mail Tabular Data dtSettings.Rows.Add(ScheduleID, "MAILTO", txtMailTo.Text); dtSettings.Rows.Add(ScheduleID, "MAILCC", txtMailCC.Text); dtSettings.Rows.Add(ScheduleID, "SUBJECT", txtSubject.Text); dtSettings.Rows.Add(ScheduleID, "MAILHEADER", txtMailHeader.Text); dtSettings.Rows.Add(ScheduleID, "MAILFOOTER", txtMailFooter.Text); dtSettings.Rows.Add(ScheduleID, "SYSTEMPROCEDURE", txtRoutineMethod.Text); break; } break; case "3": DateTime?JDCF = null; DateTime?JDCFTo = null; if (txtJCDFrom.Text.Trim().Length != 0) { JDCF = UDFLib.ConvertDateToNull(txtJCDFrom.Text); } if (txtJCDTo.Text.Trim().Length != 0) { JDCFTo = UDFLib.ConvertDateToNull(txtJCDTo.Text); } if (rdbJobCreatedBetween.Checked) { dtSettings.Rows.Add(ScheduleID, "JOBCREATEDINDAYS", null, null, null); dtSettings.Rows.Add(ScheduleID, "JOBCREATEDFROM", null, JDCF, null); dtSettings.Rows.Add(ScheduleID, "JOBCREATEDTO", null, JDCFTo, null); } else { dtSettings.Rows.Add(ScheduleID, "JOBCREATEDINDAYS", null, null, ddlJobCL.SelectedValue); dtSettings.Rows.Add(ScheduleID, "JOBCREATEDFROM", null, JDCF, null); dtSettings.Rows.Add(ScheduleID, "JOBCREATEDTO", null, JDCFTo, null); } dtSettings.Rows.Add(ScheduleID, "SHOWALLPENDINGJOBS", null, null, chkShowAllPending.Checked ? 1 : 0); dtSettings.Rows.Add(ScheduleID, "SHOWJOBCOMPLETED", null, null, chkJobCompletedIn.Checked ? 1 : 0); dtSettings.Rows.Add(ScheduleID, "SHOWJOBCOMPLETEDINDAYS", null, null, ddlJobCompletdIn.SelectedValue); string JOBTYPE = rdbJObType.SelectedValue.ToString(); dtSettings.Rows.Add(ScheduleID, "JOBTYPE", JOBTYPE, null, null); dtSettings.Rows.Add(ScheduleID, "PMSJOB", null, null, chkPMS.Checked ? 1 : 0); dtSettings.Rows.Add(ScheduleID, "PMSJOBINDAYS", ddlPMS.SelectedValue, null, null); dtSettings.Rows.Add(ScheduleID, "SENDBY", ddlReportBy.SelectedValue, null, null); if (ddlPrefFor.SelectedValue == "ME") { dtSettings.Rows.Add(ScheduleID, "SAVEPREFFORME", null, null, Convert.ToInt32(Session["USERID"])); dtSettings.Rows.Add(ScheduleID, "SAVEPREFFORDEPT", null, null, null); } else { dtSettings.Rows.Add(ScheduleID, "SAVEPREFFORDEPT", null, null, Convert.ToInt32(Session["USERDEPARTMENTID"])); dtSettings.Rows.Add(ScheduleID, "SAVEPREFFORME", null, null, null); } dtSettings.Rows.Add(ScheduleID, "MAILTO", txtMailTo.Text); dtSettings.Rows.Add(ScheduleID, "MAILCC", txtMailCC.Text); dtSettings.Rows.Add(ScheduleID, "SUBJECT", txtSubject.Text); dtSettings.Rows.Add(ScheduleID, "MAILHEADER", txtMailHeader.Text); dtSettings.Rows.Add(ScheduleID, "MAILFOOTER", txtMailFooter.Text); break; case "4": DateTime?POFD = null; DateTime?POTD = null; if (txtPOFrom.Text.Trim().Length != 0) { POFD = UDFLib.ConvertDateToNull(txtPOFrom.Text); } if (txtPOTo.Text.Trim().Length != 0) { POTD = UDFLib.ConvertDateToNull(txtPOTo.Text); } if (rdoPOCreationBetween.Checked) { dtSettings.Rows.Add(ScheduleID, "POCREATEDINDAYS", null, null, null); dtSettings.Rows.Add(ScheduleID, "POCREATEDFROM", null, POFD, null); dtSettings.Rows.Add(ScheduleID, "POCREATEDTO", null, POTD, null); } else { dtSettings.Rows.Add(ScheduleID, "POCREATEDINDAYS", null, null, ddlPOCreatedLast.SelectedValue); dtSettings.Rows.Add(ScheduleID, "POCREATEDFROM", null, POFD, null); dtSettings.Rows.Add(ScheduleID, "POCREATEDTO", null, POTD, null); } dtSettings.Rows.Add(ScheduleID, "SELECTEDSUPPLIER", null, null, chkSuppliers.Checked ? 1 : 0); // add supplier to table DataTable dtSupplier = new DataTable(); dtSupplier.Columns.Add("SUPPLIER", typeof(String)); if (chkSuppliers.Checked == true) { for (int i = 1; i < chklstSuppliers.Items.Count; i++) { if (chklstSuppliers.Items[i].Selected == true) { dtSupplier.Rows.Add(chklstSuppliers.Items[i].Value); } } } BLL_Infra_DaemonSettings.UpdateSupplierList(dtSupplier, ScheduleID, GetSessionUserID()); if (ddlPOPrefrences.SelectedValue == "ME") { dtSettings.Rows.Add(ScheduleID, "SAVEPREFFORME", null, null, Convert.ToInt32(Session["USERID"])); dtSettings.Rows.Add(ScheduleID, "SAVEPREFFORDEPT", null, null, null); } else { dtSettings.Rows.Add(ScheduleID, "SAVEPREFFORDEPT", null, null, Convert.ToInt32(Session["USERDEPARTMENTID"])); dtSettings.Rows.Add(ScheduleID, "SAVEPREFFORME", null, null, null); } dtSettings.Rows.Add(ScheduleID, "MAILTO", txtMailTo.Text); dtSettings.Rows.Add(ScheduleID, "MAILCC", txtMailCC.Text); dtSettings.Rows.Add(ScheduleID, "SUBJECT", txtSubject.Text); dtSettings.Rows.Add(ScheduleID, "MAILHEADER", txtMailHeader.Text); dtSettings.Rows.Add(ScheduleID, "MAILFOOTER", txtMailFooter.Text); break; } }
protected void btnRunProcess_Click(object sender, EventArgs e) { BLL_Infra_DaemonSettings.Execute_Daemon_Process(); Load_Current_Schedules(); }
protected void Execure_Schedule_Now(int ScheduleID) { //Daemon Grid load everytime click on RUN_NOW button BLL_Infra_DaemonSettings.Execure_Schedule_Now(ScheduleID, GetSessionUserID()); Load_Current_Schedules(); }