protected void Page_Load(object sender, EventArgs e) { clsInvoice objInv = new clsInvoice(); clsCommon objCom = new clsCommon(); Guid invID = Guid.Parse(Request.QueryString["item_number"]); string txID = Request.QueryString["tx"]; string txStatus = Request.QueryString["st"]; if (txStatus == "Completed") { lblData.Text = " Your transaction was completed successfully! "; lblData.Text += "<br/> Please make a note of the following details : "; lblData.Text += "<br/> <b> Transaction ID : </b>" + txID; lblData.Text += "<br/> <b> Paid on date : </b>" + DateTime.Now; // update db objInv.updateTransaction(invID, txID, DateTime.Now); } else { lblData.Text = " Your transaction was not completed!"; lblData.Text += "<br/> <br/>"; lblData.Text += "Please contact PayPal or your credit card provider and try again later."; } }
public string sendToFriend(string _emails, string _aid) { string result = "fail"; clsCommon objCom = new clsCommon(); string toEmail = _emails; StringBuilder strBody = new StringBuilder(); strBody.Append("<br />"); strBody.Append("<br />"); strBody.Append("<h3>Hi!</h3>"); strBody.Append("<br />"); strBody.Append("There is alert on brdhc hospital. Click <a href='www.brdhchumber.com/alerts.aspx?aid=" + _aid + "'>Here</a> to check."); strBody.Append("<br />"); string emailResult = objCom.sendEMail(toEmail, strBody.ToString(), "BRDHC Humber Alerts", true); if (string.IsNullOrEmpty(emailResult)) { result = "pass"; } else { result = emailResult; } return result; }
private void loadRecords() { // call to fuction in common class. // this function get all the records from database and bind them to gridview. clsCommon objCom = new clsCommon(); grdRecords.DataSource = objCom.getErrorLogs(); grdRecords.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["TenDangNhap"]) == "") Response.Redirect("~/dangnhap.aspx"); nhomNDDAL = new clsNhomNguoiDung_DAL(); nhomNDDTO = new clsNhomNguoiDung_DTO(); cmn = new clsCommon(); gvNhomNguoiDung.DataSource = loadDataToUI(); gvNhomNguoiDung.DataBind(); }
protected void BtnSave_Click(object sender, EventArgs e) { try { clsCommon objCommon = new clsCommon(); objCommon.ID = txtID.Text.Trim(); objCommon.ENTID = lstFile.SelectedValue; objCommon.Description = txtDesc.Text.Trim(); objCommon.CreatedBy = Session["uid"].ToString(); CMS.UNO.Core.Handler.clsCommonViewHandler.InsertCommonDetails(objCommon, "Insert", "", ref strErrMsg, ref strSuccMsg, clsCommonHandler.PageName()); if (strErrMsg.Trim().Length >= 1) { lblerror.Visible = true; lblerror.Text = strErrMsg; mpeAddCommon.Show(); return; } else { lblerror.Text = strSuccMsg; lblerror.Visible = true; txtID.Text = ""; txtDesc.Text = ""; lstFile.SelectedValue = "0"; lstFile.Focus(); mpeAddCommon.Show(); bindDataGrid(); } } catch (Exception ex) { UNOException.UNO_DBErrorLog(ex.Message, ex.StackTrace, clsCommonHandler.PageName()); } }
public bool SaveSubscriber() { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblSubscribe", tblSubscribe.ColumnNames.AppEmail, tblSubscribe.ColumnNames.AppSubscribeID, txtUserEmail.Text)) { DisplayInfoSubScribe.ShowMessage("Email address already exist", Enums.MessageType.Error); return(false); } objCommon = null; tblSubscribe objNewsLetterSubScriber = new tblSubscribe(); objNewsLetterSubScriber.AddNew(); objNewsLetterSubScriber.AppEmail = txtUserEmail.Text.Trim(); objNewsLetterSubScriber.AppIsActive = true; objNewsLetterSubScriber.AppCreatedDate = GetDateTime(); objNewsLetterSubScriber.Save(); SendMail(objNewsLetterSubScriber.s_AppSubscribeID); objNewsLetterSubScriber = null; return(true); }
public HtmlSelect FillTaluka(string DistrictID, string Taluka, int i) { DataTable dt = new DataTable(); //dt = InstituteRepository.displayTalukaWithinDistrict(DistrictID, "E"); dt = clsInstitute.displayTalukaWithinDistrict(DistrictID, "E"); HtmlSelect hTaluka = new HtmlSelect(); hTaluka.ID = Taluka; hTaluka.Attributes.Add("class", "selectbox"); if (i == 0) //for all drop downs except for 'OfficeIncharge' in OtherInformation { hTaluka.Attributes.Add("onblur", "setTaluka(this.value);"); } else //for drop down of 'OfficeIncharge' in OtherInformation { hTaluka.Attributes.Add("onblur", "setTalukaSec(this.value);"); } clsCommon common = new clsCommon(); common.fillDropDown(hTaluka, dt, "", "Text", "Value", "--- Select ---"); dt.Dispose(); return(hTaluka); }
public HtmlSelect FillDistrict(string StateID, string District, int i) { DataTable dt = new DataTable(); //dt = InstituteRepository.stateWiseDistricts(StateID, "E"); dt = clsInstitute.stateWiseDistricts(StateID, "E"); HtmlSelect hDistrict = new HtmlSelect(); hDistrict.ID = District; hDistrict.Attributes.Add("class", "selectbox"); if (i == 0) //for all drop downs except for 'OfficeIncharge' in OtherInformation { hDistrict.Attributes.Add("onchange", "FillTalukaDD(this.value);"); } else //for drop down of 'OfficeIncharge' in OtherInformation { hDistrict.Attributes.Add("onchange", "FillTalukaDDSec(this.value);"); } clsCommon common = new clsCommon(); common.fillDropDown(hDistrict, dt, "", "Text", "Value", "--- Select ---"); dt.Dispose(); return(hDistrict); }
protected void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { ViewState["SortOrder"] = appFunctions.Enum_SortOrderBy.Asc; ViewState["SortColumn"] = ""; btnAdd.Visible = HasAdd; btnDelete.Visible = HasDelete; dgvGridView.Columns[0].Visible = HasDelete; dgvGridView.Columns[1].Visible = HasEdit; if ((bool)Session[appFunctions.Session.IsSuperAdmin.ToString()]) { dgvGridView.Columns[3].Visible = HasEdit; } else { dgvGridView.Columns[3].Visible = false; } if ((Session[appFunctions.Session.ShowMessage.ToString()] != null)) { if (!string.IsNullOrEmpty(Session[appFunctions.Session.ShowMessage.ToString()].ToString())) { DInfo.ShowMessage(Session[appFunctions.Session.ShowMessage.ToString()].ToString(), (Enums.MessageType)Session[appFunctions.Session.ShowMessageType.ToString()]); Session[appFunctions.Session.ShowMessage.ToString()] = ""; Session[appFunctions.Session.ShowMessageType.ToString()] = ""; } } objCommon = new clsCommon(); objCommon.FillRecordPerPage(ref ddlPerPage); LoadDataGrid(true, false); txtSearch.Focus(); objCommon = null; } }
protected void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { ViewState["SortOrder"] = appFunctions.Enum_SortOrderBy.Asc; ViewState["SortColumn"] = ""; if ((Session[appFunctions.Session.ShowMessage.ToString()] != null)) { if (!string.IsNullOrEmpty(Session[appFunctions.Session.ShowMessage.ToString()].ToString())) { DInfo.ShowMessage(Session[appFunctions.Session.ShowMessage.ToString()].ToString(), (Enums.MessageType)Session[appFunctions.Session.ShowMessageType.ToString()]); Session[appFunctions.Session.ShowMessage.ToString()] = ""; Session[appFunctions.Session.ShowMessageType.ToString()] = ""; } } objCommon = new clsCommon(); objCommon.FillRecordPerPage(ref ddlPerPage); LoadDataGrid(true, false); txtSearch.Focus(); objCommon = null; SetTab(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ViewState["SortOrder"] = appFunctions.Enum_SortOrderBy.Asc; ViewState["SortColumn"] = ""; lnkSaveAndAddnew.Visible = HasAdd; SetRegularExpression(); //objCommon = new clsCommon(); //objCommon.FillDropDownList(ddlCourierCompany, "tblCourierCompany", tblCourierCompany.ColumnNames.AppCourierCompany, tblCourierCompany.ColumnNames.AppCourierCompanyID, "-- Select Courier Company --", tblCourierCompany.ColumnNames.AppCourierCompany, appFunctions.Enum_SortOrderBy.Asc); //objCommon = null; objCommon = new clsCommon(); objCommon.FillDropDownList(ddlPINCode, "tblPinCode", tblPinCode.ColumnNames.AppPinCode, tblPinCode.ColumnNames.AppPinCodeID, "--Select PIN Code--", tblPinCode.ColumnNames.AppPinCodeID, appFunctions.Enum_SortOrderBy.Asc, tblPinCode.ColumnNames.AppIsActive + "=1"); objCommon = null; if ((Request.QueryString.Get("ID") != null)) { objEncrypt = new clsEncryption(); try { hdnPKID.Value = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey); } catch (Exception ex) { // noIdFoundRedirect("Employee.aspx"); } objEncrypt = null; SetValuesToControls(); LoadAllData(); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "HideTab()", true); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ViewState["SortOrder"] = appFunctions.Enum_SortOrderBy.Asc; ViewState["SortColumn"] = ""; dgvGridView.Columns[0].Visible = HasDelete; if (Session[appFunctions.Session.ShowMessage.ToString()] != null) { if (!string.IsNullOrEmpty(Session[appFunctions.Session.ShowMessage.ToString()].ToString())) { DInfo.ShowMessage(Session[appFunctions.Session.ShowMessage.ToString()].ToString(), (Enums.MessageType)Session[appFunctions.Session.ShowMessageType.ToString()]); Session[appFunctions.Session.ShowMessage.ToString()] = ""; Session[appFunctions.Session.ShowMessageType.ToString()] = ""; } } objCommon = new clsCommon(); objCommon.FillRecordPerPage(ref ddlPerPage); if ((Request.QueryString.Get("ID") != null)) { objEncrypt = new clsEncryption(); try { string pid = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey); } catch (Exception ex) { } } LoadDataGrid(true, false); txtSearch.Focus(); objCommon = null; } }
private void SendMail(int strStatus, string strOrderID) { string strEmail = ""; try { objCommon = new clsCommon(); string Strbody = ""; string strSubject = "Fabymart.com order confirmed - " + strOrderID; Strbody = objCommon.readFile(Server.MapPath("~/EmailTemplates/OrderConfirmation.html")); Strbody = Strbody.Replace("`orderno`", strOrderID); if (strStatus == Convert.ToInt32(Enums.Enums_OrderStatus.Complete)) { Strbody = Strbody.Replace("`orderstatus`", "Complete"); } else if (strStatus == Convert.ToInt32(Enums.Enums_OrderStatus.CancelledByAdmin)) { Strbody = Strbody.Replace("`orderstatus`", "Cancelled By FabyMart"); } Strbody = Strbody.Replace("`orderdate`", GetCurrentDateTime().ToString()); tblOrder objOrder = new tblOrder(); if (objOrder.LoadByPrimaryKey(Convert.ToInt32(strOrderID))) { strEmail = objOrder.AppRecevierEmail; } objOrder = null; objCommon.SendConfirmationMail(strEmail, strSubject, Strbody, Enums.Enum_Confirmation_Mail_type.order); strEmail = ""; objCommon = null; } catch (Exception ex) { Response.Write(ex.StackTrace.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { lnkSaveAndAddnew.Visible = HasAdd; objCommon = new clsCommon(); objCommon.FillDropDownList(ddlCountry, "tblCountry", tblCountry.ColumnNames.AppCountry, tblCountry.ColumnNames.AppCountryID, "-- Select Category --"); objCommon = null; if ((Request.QueryString.Get("ID") != null)) { objEncrypt = new clsEncryption(); try { hdnPKID.Value = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey); } catch (Exception ex) { // noIdFoundRedirect("Employee.aspx"); } objEncrypt = null; SetValuesToControls(); } } }
public void SendMail(string strId) { try { PageBase objPageBase = new PageBase(); objCommon = new clsCommon(); string Strbody = ""; string strSubject = "Account Activation Process"; Strbody = objCommon.readFile(Server.MapPath("~/EmailTemplates/NewUserMail.html")); Strbody = Strbody.Replace("`link`", strServerURL); Strbody = Strbody.Replace("`uname`", txtFirstName.Text + " " + txtLastName.Text); objEncrypt = new clsEncryption(); Strbody = Strbody.Replace("`linkActive`", objPageBase.GetAlias("Approved.aspx") + objEncrypt.Encrypt(strId, appFunctions.strKey)); objEncrypt = null; objCommon.SendConfirmationMail(txtEmailRegistration.Text, strSubject, Strbody, Enums.Enum_Confirmation_Mail_type.register); //objCommon.SendMail(txtEmailRegistration.Text, strSubject, Strbody); objCommon = null; objPageBase = null; } catch (Exception ex) { Response.Write(ex.StackTrace.ToString()); } }
protected void dgvSubCategory_RowCommand(object sender, GridViewCommandEventArgs e) { if (!string.IsNullOrEmpty(e.CommandArgument.ToString())) { objCommon = new clsCommon(); if (e.CommandName == "Edit") { hdnSubCategoryId.Value = e.CommandArgument.ToString(); SetSubCategoryValuesToControls(); } else if (e.CommandName == "Up") { LinkButton inkButton = (LinkButton)e.CommandSource; GridViewRow drCurrent = (GridViewRow)inkButton.Parent.Parent; if (drCurrent.RowIndex > 0) { GridViewRow drUp = dgvSubCategory.Rows[drCurrent.RowIndex - 1]; objCommon.SetDisplayOrder("tblSizeSubCategory", tblSizeSubCategory.ColumnNames.AppSizeSubCategoryID, tblSizeSubCategory.ColumnNames.AppDisplayOrder, (int)dgvSubCategory.DataKeys[drCurrent.RowIndex].Values[0], (int)dgvSubCategory.DataKeys[drCurrent.RowIndex].Values[1], (int)dgvSubCategory.DataKeys[drUp.RowIndex].Values[0], (int)dgvSubCategory.DataKeys[drUp.RowIndex].Values[1]); LoadSubCategoryData(false, false); objCommon = null; } } else if (e.CommandName == "Down") { LinkButton lnkButton = (LinkButton)e.CommandSource; GridViewRow drCurrent = (GridViewRow)lnkButton.Parent.Parent; if (drCurrent.RowIndex < dgvSubCategory.Rows.Count - 1) { GridViewRow drUp = dgvSubCategory.Rows[drCurrent.RowIndex + 1]; objCommon.SetDisplayOrder("tblSizeSubCategory", tblSizeSubCategory.ColumnNames.AppSizeSubCategoryID, tblSizeSubCategory.ColumnNames.AppDisplayOrder, (int)dgvSubCategory.DataKeys[drCurrent.RowIndex].Values[0], (int)dgvSubCategory.DataKeys[drCurrent.RowIndex].Values[1], (int)dgvSubCategory.DataKeys[drUp.RowIndex].Values[0], (int)dgvSubCategory.DataKeys[drUp.RowIndex].Values[1]); LoadSubCategoryData(false, false); objCommon = null; } } } }
public void check() { try { clsCommon obj = new clsCommon(); int level = Convert.ToInt32(Session["level"]); if (obj.CheckUserRight("User Privilege settings", level) == 0) { string prevPage = Request.UrlReferrer.ToString(); ViewState["prevform"] = prevPage; ViewState["action"] = "check"; okmessage("Tsunami ARMS - Warning", "Not authorized to access this page"); this.ScriptManager1.SetFocus(btnOk); } } catch (Exception ex) { Response.Redirect("~/Login frame.aspx"); } finally { con.Close(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckSession(); SetRegulerExpression(); if ((Session[appFunctions.Session.ShowMessage.ToString()] != null)) { if (!string.IsNullOrEmpty(Session[appFunctions.Session.ShowMessage.ToString()].ToString())) { DInfo.ShowMessage(Session[appFunctions.Session.ShowMessage.ToString()].ToString(), (Enums.MessageType)Session[appFunctions.Session.ShowMessageType.ToString()]); Session[appFunctions.Session.ShowMessage.ToString()] = ""; Session[appFunctions.Session.ShowMessageType.ToString()] = ""; } } objCommon = new clsCommon(); objCommon.FillDropDownList(ddlCourierCompany, "tblCourierCompany ", tblCourierCompany.ColumnNames.AppCourierCompany, tblCourierCompany.ColumnNames.AppCourierCompanyID, "--Select Courier Company--", tblCourierCompany.ColumnNames.AppDisplayOrder, appFunctions.Enum_SortOrderBy.Asc, tblCourierCompany.ColumnNames.AppIsActive + "=1"); ddlCourierCompany.Items.Add(new ListItem("Other", "-1")); objCommon = null; SetUpPageContent(ref metaDescription, ref metaKeywords); LoadMyorderList(); } }
protected void dgvGridView_RowCommand1(object sender, GridViewCommandEventArgs e) { if (!string.IsNullOrEmpty(e.CommandArgument.ToString())) { objCommon = new clsCommon(); if (e.CommandName == "IsActive") { objSize = new tblSize(); if (objSize.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()))) { if (!objSize.AppIsDefault) { if (objSize.AppIsActive == true) { objSize.AppIsActive = false; } else if (objSize.AppIsActive == false) { objSize.AppIsActive = true; } objSize.Save(); LoadDataGrid(false, false); } } objSize = null; objCommon = null; } else if (e.CommandName == "IsDefault") { objSize = new tblSize(); objSize.SetDefaultSize(e.CommandArgument.ToString()); objSize = null; LoadDataGrid(false, false); } } }
private void FillBranch(string Uni_ID, string Inst_ID, string Fac_ID, string Cr_ID, string Molrn_ID, string Ptrn_ID) { ddlCrBrnDesc.Items.Clear(); oDT = new System.Data.DataTable(); try { if (hidInstID.Value != "") { oDT = oInstituteRepository.AssignedConfirmedBranches(Uni_ID, Inst_ID, Fac_ID, Cr_ID, Molrn_ID, Ptrn_ID); } else { oDT = crRepository.ListCourseModeOfLearningPatternWiseLaunchedBranches(long.Parse(Uni_ID), long.Parse(Fac_ID), long.Parse(Cr_ID), long.Parse(Molrn_ID), long.Parse(Ptrn_ID)); } if (oDT.Rows.Count > 0) { Common = new clsCommon(); if (oDT.Rows.Count == 1) { if (Convert.ToString(oDT.Rows[0]["Text"]) == "No Branch") { ListItem li = new ListItem(); li.Text = "No Branch Available"; li.Value = "0"; ddlCrBrnDesc.Items.Add(li); FillCoursePart(Uni_ID, Inst_ID, Fac_ID, Cr_ID, Molrn_ID, Ptrn_ID, "0"); } else { Common.fillDropDown(ddlCrBrnDesc, oDT, "-1", "Text", "Value", "---- Select ----"); } } else { Common.fillDropDown(ddlCrBrnDesc, oDT, "-1", "Text", "Value", "---- Select ----"); } if (Common != null) { Common = null; } } else { if (ddlCrDesc.SelectedIndex == 0) { ListItem li = new ListItem(); li.Text = "---- Select ----"; li.Value = "-1"; ddlCrBrnDesc.Items.Add(li); } else { ListItem li = new ListItem(); li.Text = "No Branch Available"; li.Value = "0"; ddlCrBrnDesc.Items.Add(li); } } } catch (Exception e) { } }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["TenDangNhap"]) == "") Response.Redirect("~/dangnhap.aspx"); ctdthiDAL = new clsCauTrucDeThi_DAL(); ctdthiDTO = new clsCauTrucDeThi_DTO(); loaichoiDAL = new clsLoaiCauHoi_DAL(); loaichoiDTO = new clsLoaiCauHoi_DTO(); lbangDAL = new clsLoaiBanglai_DAL(); lbangDTO = new clsLoaiBanglai_DTO(); cmn = new clsCommon(); if (!IsPostBack || !IsCallback) { } if (!Page.IsPostBack) { } loadMasterData(); if (cboLoaiBang.Value != null) { gvCauTrucDeThi.DataSource = loadDataToUI(); gvCauTrucDeThi.DataBind(); } }
protected void ddlState_SelectedIndexChanged(object sender, EventArgs e) { objCommon = new clsCommon(); objCommon.FillDropDownList(ddlCity, "tblCity", tblCity.ColumnNames.AppCity, tblCity.ColumnNames.AppCityID, "-- Select City --", tblCity.ColumnNames.AppStateID + "=" + ddlState.SelectedValue); objCommon = null; }
/// <summary> /// Check whether data of user is valid /// </summary> /// <returns></returns> /// <remarks> /// Author: PhatLT. FPTSS. /// Created date: 14/02/2011 /// </remarks> public bool ValidateData() { DataRowView rview = (DataRowView)_manager.Current; DataRow row = rview.Row; clsCommon common = new clsCommon(); row.ClearErrors(); ep.SetError(txtConfirmPassword, ""); string userName = row["USERNAME"].ToString(); if (userName.Length == 0) { row.SetColumnError("USERNAME", clsResources.GetMessage("errors.required", lblUserName.Text)); txtUserName.Focus(); return(false); } else if (!common.IsLetterAndDigit(userName)) { row.SetColumnError("USERNAME", clsResources.GetMessage("errors.string.specialChar", lblUserName.Text)); txtUserName.Focus(); return(false); } if (row["PASSWORD"].ToString().Length == 0) { row.SetColumnError("PASSWORD", clsResources.GetMessage("errors.required", lblPassword.Text)); txtPassword.Focus(); return(false); } if (txtConfirmPassword.Text != txtPassword.Text) { ep.SetError(txtConfirmPassword, clsResources.GetMessage("errors.compare.equal", lblConfirmPassword.Text, lblPassword.Text)); return(false); } if (row["FIRSTNAME"].ToString().Length == 0) { row.SetColumnError("FIRSTNAME", clsResources.GetMessage("errors.required", lblFirstName.Text)); txtFirstName.Focus(); return(false); } if (row["LASTNAME"].ToString().Length == 0) { row.SetColumnError("LASTNAME", clsResources.GetMessage("errors.required", lblLastName.Text)); txtFirstName.Focus(); return(false); } if (row["EMAIL"] == DBNull.Value) { row.SetColumnError("EMAIL", clsResources.GetMessage("errors.required", lblEmail.Text)); txtEmail.Focus(); return(false); } else if (row["EMAIL"].ToString().Length > 0 && !common.IsEmail(row["EMAIL"].ToString())) { row.SetColumnError("EMAIL", clsResources.GetMessage("errors.email", lblAddress.Text)); txtAddress.Focus(); return(false); } if (row["ADDRESS"] == DBNull.Value) { row.SetColumnError("ADDRESS", clsResources.GetMessage("errors.required", lblAddress.Text)); txtAddress.Focus(); return(false); } if (row["PHONE"] == DBNull.Value) { row.SetColumnError("PHONE", clsResources.GetMessage("errors.required", lblPhone.Text)); txtPhone.Focus(); return(false); } if (txtStartDate.Value > txtEndDate.Value) { row.SetColumnError("END_DATE", clsResources.GetMessage("errors.compare.datetime", lblStartDate.Text, lblEndDate.Text)); txtStartDate.Focus(); return(false); } if (row["UROLE_ID"] == DBNull.Value) { row.SetColumnError("UROLE_ID", clsResources.GetMessage("errors.required", lblURoleID.Text)); cboURoleID.Focus(); return(false); } if (row["STATUS"] == DBNull.Value) { row.SetColumnError("STATUS", clsResources.GetMessage("errors.required", lblStatus.Text)); cboURoleID.Focus(); return(false); } if (row["DESCRIPTION"] == DBNull.Value) { row.SetColumnError("DESCRIPTION", clsResources.GetMessage("errors.required", lblDescription.Text)); txtDescription.Focus(); return(false); } if (!bln_IsEdit && bo.Exist(row["USERNAME"].ToString())) { row.SetColumnError("USERNAME", clsResources.GetMessage("errors.userName.exist")); txtUserName.Focus(); return(false); } return(true); }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["TenDangNhap"]) == "") Response.Redirect("~/dangnhap.aspx"); pthiDAL = new clsPhongThi_DAL(); pthiDTO = new clsPhongThi_DTO(); dthiDAL = new clsDiaDiemThi_DAL(); //dthiDTO = new clsDiaDiemThi_DTO(); cmn = new clsCommon(); if (!IsPostBack || !IsCallback) { } if (!Page.IsPostBack) { } loadMasterData(); if (cboDiemThi.Value != null) { pthiDTO.MaDiemThi = cboDiemThi.Value.ToString(); gvPhongThi.DataSource = loadDataToUI(pthiDTO); gvPhongThi.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { try { btnprintout_Click(this, null); DataTable dt = (DataTable)Session["tableF"]; if (dt != null) { if (dt.Rows.Count > 0) { GridView1.DataSource = dt;//ds.Tables[0].Select("RoD_Name = '" + ddlRODName.SelectedItem.Text + "' and EPEB_Type_Desc = '" + ddlEPEBType.SelectedItem.Text + "' and EPEB_ENO = '" + txtEPEBNo.Text + "'"); GridView1.DataBind(); #region Added Riyaz /* This Code Added in 04/07/2011 because of CRF_OTM_02_01 */ if (dt.Rows[0]["Activity_ID"].ToString().ToUpper() == "CLOSED") { GridView1.HeaderRow.Cells[5].Text = "Closed Date"; } else if (dt.Rows[0]["Activity_ID"].ToString().ToUpper() == "WITHDRAWN") { GridView1.HeaderRow.Cells[5].Text = "Withdrawn Date"; } else if (dt.Rows[0]["Activity_ID"].ToString().ToUpper() == "VOIDED") { GridView1.HeaderRow.Cells[5].Text = "Voided Date"; } else { GridView1.Columns[5].Visible = false; } #endregion GridView1.Visible = true; PnlGrid.Visible = true; clsCommon cl = new clsCommon(); string fileLocation = cl.GetNewPath(HttpContext.Current); //FileAttributes fileAttributes = File.GetAttributes(fileLocation + "\\TransactionStatus.xml"); //FileInfo f = new FileInfo(fileLocation + "\\TransactionStatus.xml"); //Lbldate.Text = f.LastWriteTime.ToLongDateString().Trim(); //LblTime.Text = f.LastWriteTime.ToLongTimeString().Trim(); DataSet ds1 = new DataSet(); ds1.ReadXml(fileLocation + "\\ExtractTime.xml"); Lbldate.Text = ds1.Tables[0].Rows[0][0].ToString().Trim(); Lbldate.Visible = true; LblTime.Visible = true; Lblcreatedate.Visible = true; Label1.Visible = true; } else { GridView1.DataSource = null; GridView1.DataBind(); Lbldate.Visible = false; LblTime.Visible = false; Lblcreatedate.Visible = false; Label1.Visible = false; } } } catch (Exception ex) { } }
protected void dgvGridView_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { if (!string.IsNullOrEmpty(e.CommandArgument.ToString())) { objCommon = new clsCommon(); if (e.CommandName == "Up") { LinkButton inkButton = (LinkButton)e.CommandSource; GridViewRow drCurrent = (GridViewRow)inkButton.Parent.Parent; if (drCurrent.RowIndex > 0) { GridViewRow drUp = dgvGridView.Rows[drCurrent.RowIndex - 1]; objCommon.SetDisplayOrder("tblColor", tblColor.ColumnNames.AppColorID, tblColor.ColumnNames.AppDisplayOrder, (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[0], (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[1], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[0], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[1]); LoadDataGrid(false, false); objCommon = null; } } else if (e.CommandName == "Down") { LinkButton lnkButton = (LinkButton)e.CommandSource; GridViewRow drCurrent = (GridViewRow)lnkButton.Parent.Parent; if (drCurrent.RowIndex < dgvGridView.Rows.Count - 1) { GridViewRow drUp = dgvGridView.Rows[drCurrent.RowIndex + 1]; objCommon.SetDisplayOrder("tblColor", tblColor.ColumnNames.AppColorID, tblColor.ColumnNames.AppDisplayOrder, (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[0], (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[1], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[0], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[1]); LoadDataGrid(false, false); objCommon = null; } } else if (e.CommandName == "IsActive") { objColor = new tblColor(); if (objColor.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()))) { if (!objColor.AppIsDefault) { if (objColor.AppIsActive == true) { objColor.AppIsActive = false; } else if (objColor.AppIsActive == false) { objColor.AppIsActive = true; } objColor.Save(); LoadDataGrid(false, false); } } objColor = null; } else if (e.CommandName == "IsDefault") { objColor = new tblColor(); objColor.SetDefaultColor(e.CommandArgument.ToString()); objColor = null; LoadDataGrid(false, false); } } }
public ActionResult getData(clsCommon cls) { var project = (from data in db.tblProjects where data.ProjectId == cls.intProjectId select data).FirstOrDefault(); return(Json(project, JsonRequestBehavior.AllowGet)); }
protected void dgvGridView_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e) { DataControlRowType itemType = e.Row.RowType; switch (itemType) { case DataControlRowType.DataRow: string strOrderID = dgvGridView.DataKeys[e.Row.RowIndex].Values[0].ToString(); string strPaymentMode = dgvGridView.DataKeys[e.Row.RowIndex].Values[3].ToString(); string strCourierCompanyId = dgvGridView.DataKeys[e.Row.RowIndex].Values[1].ToString(); string strDocketNo = dgvGridView.DataKeys[e.Row.RowIndex].Values[2].ToString(); if (strOrderID != "") { GridView dgvGrid = (GridView)e.Row.FindControl("dgvSubDetail"); if (dgvGrid != null) { objSubOrder = new tblSubOrder(); dgvGrid.DataSource = objSubOrder.GetSubOrderDetailList(strOrderID, Convert.ToInt32(Enums.Enums_OrderStatus.Shipped).ToString()); dgvGrid.DataBind(); objSubOrder = null; } } if (strPaymentMode != "") { Label lblPaymentMode = (Label)e.Row.FindControl("lblPaymentMode"); if (strPaymentMode == Convert.ToInt32(Enums.PaymentMode.COD).ToString()) { lblPaymentMode.Text = "COD"; lblPaymentMode.BackColor = System.Drawing.Color.Brown; } if (strPaymentMode == Convert.ToInt32(Enums.PaymentMode.PayNow).ToString()) { lblPaymentMode.Text = "Pre-Paid"; lblPaymentMode.BackColor = System.Drawing.Color.Green; } } System.Web.UI.HtmlControls.HtmlGenericControl divCourierCompany = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Row.FindControl("divCourierCompany"); divCourierCompany.Visible = false; TextBox txtDocketNo = (TextBox)e.Row.FindControl("txtDocketNo"); LinkButton lnkAddDocketNo = (LinkButton)e.Row.FindControl("lnkAddDocketNo"); if (strDocketNo != "") { objSubOrder = new tblSubOrder(); txtDocketNo.Text = strDocketNo; txtDocketNo.Style.Add("display", "block"); txtDocketNo.Enabled = false; lnkAddDocketNo.Visible = false; objSubOrder = null; } else if (strCourierCompanyId != "" && strDocketNo == "") { txtDocketNo.Style.Add("display", "block"); lnkAddDocketNo.Visible = true; } else if (strCourierCompanyId == "" && strDocketNo == "") { txtDocketNo.Style.Add("display", "none"); lnkAddDocketNo.Visible = false; divCourierCompany.Visible = true; DropDownList ddlCourierCompany = (DropDownList)e.Row.FindControl("ddlCourierCompany"); objCommon = new clsCommon(); objCommon.FillDropDownListWithOutDefaultValue(ddlCourierCompany, "tblCourierCompany", tblCourierCompany.ColumnNames.AppCourierCompany, tblCourierCompany.ColumnNames.AppCourierCompanyID, tblCourierCompany.ColumnNames.AppDisplayOrder, appFunctions.Enum_SortOrderBy.Asc, tblCourierCompany.ColumnNames.AppIsActive + "=1"); objCommon = null; } break; } }
protected void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { ifError = false; ViewState["SortOrder"] = appFunctions.Enum_SortOrderBy.Asc; ViewState["SortColumn"] = ""; btnAdd.Visible = HasAdd; btnDelete.Visible = HasDelete; dgvGridView.Columns[0].Visible = HasDelete; dgvGridView.Columns[1].Visible = HasEdit; dgvGridView.Columns[5].Visible = HasEdit; if ((Session[appFunctions.Session.ShowMessage.ToString()] != null)) { if (!string.IsNullOrEmpty(Session[appFunctions.Session.ShowMessage.ToString()].ToString())) { DInfo.ShowMessage(Session[appFunctions.Session.ShowMessage.ToString()].ToString(), (Enums.MessageType)Session[appFunctions.Session.ShowMessageType.ToString()]); Session[appFunctions.Session.ShowMessage.ToString()] = ""; Session[appFunctions.Session.ShowMessageType.ToString()] = ""; } } objCommon = new clsCommon(); objCommon.FillRecordPerPage(ref ddlPerPage); if ((Request.QueryString.Get("ID") != null)) { objEncrypt = new clsEncryption(); try { hdnPKID.Value = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey); intSiteMapId = Convert.ToInt32(hdnPKID.Value); } catch (Exception ex) { // noIdFoundRedirect("Employee.aspx"); } objEncrypt = null; if ((Request.QueryString.Get("type") != null)) { if ((Request.QueryString.Get("type") == "mtype")) { hdnType.Value = "mtype"; } else { hdnType.Value = ""; } } else { hdnType.Value = ""; } } if (intSiteMapId != -1) { DataTable dt = new DataTable(); objEncrypt = new clsEncryption(); dynamic objTempMenuItem = new tblMenuItem(); if (hdnType.Value == "") { dt = objTempMenuItem.GetSiteMap(intSiteMapId); strSiteMapData = dt.Rows[0][0].ToString(); dt = objTempMenuItem.GetMenuType(intSiteMapId, false); } else { dt = objTempMenuItem.GetMenuType(intSiteMapId, true); } String[] SplitSiteMapString = strSiteMapData.Split('/'); strSiteMap = "<a href='MasterMenus.aspx'>Menu Items</a>"; if (SplitSiteMapString.Length > 1) { strSiteMap += " > <a href=MenuItems.aspx?Id=" + objEncrypt.Encrypt(dt.Rows[0]["appMenuTypeId"].ToString(), appFunctions.strKey) + "&type=mtype>" + dt.Rows[0]["appMenuTypeName"].ToString() + "</a>"; //strSiteMap = "<a href='MenuItems.aspx'>Parent Tabs </a>"; } else { strSiteMap += " > " + dt.Rows[0]["appMenuTypeName"].ToString(); } for (int i = 0; i <= SplitSiteMapString.Length - 2; i += 1) { String[] SplittedItems = SplitSiteMapString.GetValue(i).ToString().Split(','); if (i == SplitSiteMapString.Length - 2) { strSiteMap += " > " + SplittedItems.GetValue(0); } else { strSiteMap += " > <a href='MenuItems.aspx?Id=" + objEncrypt.Encrypt(SplittedItems.GetValue(1).ToString(), appFunctions.strKey) + "'> " + SplittedItems.GetValue(0) + "</a>"; } } litSiteMap.Text = strSiteMap; } LoadDataGrid(true, false); txtSearch.Focus(); objCommon = null; } }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["TenDangNhap"]) == "") Response.Redirect("~/dangnhap.aspx"); dthiDAL = new clsDiaDiemThi_DAL(); dthiDTO = new clsDiaDiemThi_DTO(); cmn = new clsCommon(); gvDiaDiemThi.DataSource = loadDataToUI(); gvDiaDiemThi.DataBind(); }
protected void subPublish(object sender, EventArgs e) { // this will do the save or update but will also publish the alert. Then the alert will be published on the hoem page if (Page.IsValid) { MembershipUser user = Membership.GetUser(); lblErr.Visible = true; try { string title = txtATitle.Text; string description = txtDesc.Text; objHAlerts.resetForPublish(); // check for save and update if (_healthAlertId == null || _healthAlertId == Guid.Empty) { _healthAlertId = Guid.NewGuid(); objHAlerts.saveHealthAlert(_healthAlertId, title, description, DateTime.Now, user.ProviderUserKey.ToString(), true); } else { objHAlerts.updateHealthAlert(_healthAlertId, title, description, DateTime.Now, user.ProviderUserKey.ToString(), true); } lblErr.Text = "Health Alert published successfully."; clsCommon objCom = new clsCommon(); string appName = WebConfigurationManager.AppSettings["appName"].ToString(); // now if publish is successfull // then get all the emails of users from brdhc_AlertSubscribers // send each an email containing the alert as body part./ List<sp_getAlertSubscribersResult> objEmails = objCom.sp_getAlertSubscribers(appName); foreach (sp_getAlertSubscribersResult record in objEmails) { string fullName = ""; string toEmail = ""; string subscriberId = ""; StringBuilder strBody = new StringBuilder(); if (record.Name != null) { fullName = record.Name.ToString(); } toEmail = record.Email.ToString(); subscriberId = record.UserId.ToString(); strBody.Append("<br />"); strBody.Append("<br />"); strBody.Append("<h3>Hi! " + fullName + "</h3>"); strBody.Append("<br />"); strBody.Append("<br />"); strBody.Append("We thought to notify you that there is an alert <a href='www.brdhchumber.com'>" + title + "</a>"); strBody.Append("<br />"); strBody.Append("Below is the description. Please look at it and forward this to others."); strBody.Append("<br />"); strBody.Append("<br />"); strBody.Append(description); strBody.Append("<br />"); strBody.Append("<b>Note: </b> If you do not want to get future emails <a href='http://www.brdhchumber.com/unsubscribe.aspx?uid=" + subscriberId + "'>unsubscribe<a/> here."); strBody.Append("<br />"); strBody.Append("Wishing you very healthy life."); strBody.Append("<br />"); strBody.Append("Team Humber"); string emailResult = objCom.sendEMail(toEmail, strBody.ToString(), "BRDHC Humber Alerts", true); } } catch (Exception ex) { lblErr.Text = ex.Message.ToString(); clsCommon.saveError(ex); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //LoadCategoryMenu(); clsCommon objCommon = new clsCommon(); objCommon.FillDropDownListWithOutDefaultValue(ddlCurrency, "tblCurrency", tblCurrency.ColumnNames.AppCurrency, tblCurrency.ColumnNames.AppCurrencyID, tblCurrency.ColumnNames.AppDisplayOrder, appFunctions.Enum_SortOrderBy.Asc, tblCurrency.ColumnNames.AppIsActive + "=1"); objCommon = null; if (Session[appFunctions.Session.CurrencyID.ToString()] != null) { if (Session[appFunctions.Session.CurrencyID.ToString()].ToString() != "") { ddlCurrency.SelectedValue = Session[appFunctions.Session.CurrencyID.ToString()].ToString(); } } if ((Session[appFunctions.Session.ClientUserID.ToString()] != null)) { if (!(string.IsNullOrEmpty(Session[appFunctions.Session.ClientUserName.ToString()].ToString()) | Session[appFunctions.Session.ClientUserID.ToString()].ToString() == "0")) { divLogOut.Style.Add("display", "inline"); divLogin.Style.Add("display", "none"); } } else { divLogin.Style.Add("display", "inline"); divLogOut.Style.Add("display", "none"); } if (Session[appFunctions.Session.ClientUserID.ToString()] != null) { if (Session[appFunctions.Session.ClientUserID.ToString()].ToString() != "") { // liAccount.Visible = true; tblFavouriteProduct objFavProduct = new tblFavouriteProduct(); objFavProduct.Where.AppCustomerID.Value = Session[appFunctions.Session.ClientUserID.ToString()].ToString(); objFavProduct.Query.Load(); lblWishCount.Text = "(" + objFavProduct.RowCount.ToString() + ")"; objFavProduct = null; lblClientName.Text = "Hi, " + Session[appFunctions.Session.ClientUserName.ToString()].ToString(); } else { // liAccount.Visible = false; } } else { // liAccount.Visible = false; } lnkCart.HRef = Request.RawUrl + "#"; DataTable dtCart = new DataTable(); if ((HttpContext.Current.Session[appFunctions.Session.Cart.ToString()] != null)) { dtCart = (DataTable)HttpContext.Current.Session[appFunctions.Session.Cart.ToString()]; } if (dtCart.Rows.Count > 0) { lblProductCount.Visible = true; lblProductCount.Text = dtCart.Rows.Count.ToString(); lnkCart.HRef = objPageBase.GetAlias("Order.aspx"); } else { lblProductCount.Visible = false; } } }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["TenDangNhap"]) == "") Response.Redirect("~/dangnhap.aspx"); ndungDAL = new clsNguoiDung_DAL(); ndungDTO = new clsNguoiDung_DTO(); dthiDAL = new clsDiaDiemThi_DAL(); dthiDTO = new clsDiaDiemThi_DTO(); nhomNDDAL = new clsNhomNguoiDung_DAL(); nhomNDDTO = new clsNhomNguoiDung_DTO(); cmn = new clsCommon(); loadMasterData(); if (cboDienThi.Value != null) { //dotthiDTO.MaLoaiBang = cboLoaiBang.Value.ToString(); ndungDTO.MaDiemThi = cboDienThi.Value.ToString(); gvNguoiDung.DataSource = loadDataToUI(); gvNguoiDung.DataBind(); } }
private void SendShippingMail(string strOrderID) { try { tblOrder objOrder = new tblOrder(); objDataTable = objOrder.GetShippedOrderInfo(strOrderID, Convert.ToInt32(Enums.Enums_OrderStatus.Shipped).ToString()); if (objDataTable.Rows.Count > 0) { objCommon = new clsCommon(); string Strbody = ""; string strSubject = "Order Shipped- Your order #" + objDataTable.Rows[0][tblOrder.ColumnNames.AppOrderNo].ToString() + " has been shipped!"; if (Convert.ToInt32(objDataTable.Rows[0][tblOrder.ColumnNames.AppPaymentMode].ToString()) == Convert.ToInt32(Enums.PaymentMode.COD)) { Strbody = objCommon.readFile(Server.MapPath("~/Admin/EmailTemplates/CODOrderShipped.html")); } else { Strbody = objCommon.readFile(Server.MapPath("~/Admin/EmailTemplates/OrderShipped.html")); } Strbody = Strbody.Replace("`link`", strServerURL); Strbody = Strbody.Replace("`uname`", objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverName].ToString()); Strbody = Strbody.Replace("`orderno`", objDataTable.Rows[0][tblOrder.ColumnNames.AppOrderNo].ToString()); Strbody = Strbody.Replace("`date`", Convert.ToDateTime(objDataTable.Rows[0][tblOrder.ColumnNames.AppCreatedDate].ToString()).ToString("MMMM dd, yyyy HH:MM:ss tt")); Strbody = Strbody.Replace("`ShippedBy`", objDataTable.Rows[0][tblCourierCompany.ColumnNames.AppCourierCompany].ToString()); Strbody = Strbody.Replace("`TrackingNumber`", objDataTable.Rows[0][tblSubOrder.ColumnNames.AppDocketNo].ToString()); Strbody = Strbody.Replace("`name`", objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverName].ToString()); Strbody = Strbody.Replace("`address`", objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverAddress].ToString()); Strbody = Strbody.Replace("`city`", objDataTable.Rows[0][tblCity.ColumnNames.AppCity].ToString()); Strbody = Strbody.Replace("`state`", objDataTable.Rows[0][tblState.ColumnNames.AppState].ToString()); Strbody = Strbody.Replace("`country`", objDataTable.Rows[0][tblCountry.ColumnNames.AppCountry].ToString()); Strbody = Strbody.Replace("`pincode`", objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverPIN].ToString()); Strbody = Strbody.Replace("`mobile`", objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverContactNo1].ToString()); Strbody = Strbody.Replace("`email`", objDataTable.Rows[0][tblOrder.ColumnNames.AppRecevierEmail].ToString()); Strbody = Strbody.Replace("`billname`", objDataTable.Rows[0][tblOrder.ColumnNames.AppBillReceiverName].ToString()); Strbody = Strbody.Replace("`billaddress`", objDataTable.Rows[0][tblOrder.ColumnNames.AppBillReceiverAddress].ToString()); Strbody = Strbody.Replace("`billcity`", objDataTable.Rows[0]["AppBillCity"].ToString()); Strbody = Strbody.Replace("`billstate`", objDataTable.Rows[0]["AppBillState"].ToString()); Strbody = Strbody.Replace("`billcountry`", objDataTable.Rows[0]["AppBillCountry"].ToString()); Strbody = Strbody.Replace("`billpincode`", objDataTable.Rows[0][tblOrder.ColumnNames.AppBillReceiverPIN].ToString()); Strbody = Strbody.Replace("`billmobile`", objDataTable.Rows[0][tblOrder.ColumnNames.AppBillReceiverContactNo1].ToString()); Strbody = Strbody.Replace("`billemail`", objDataTable.Rows[0][tblOrder.ColumnNames.AppBillRecevierEmail].ToString()); objCommon.SendConfirmationMail(objDataTable.Rows[0][tblOrder.ColumnNames.AppRecevierEmail].ToString(), strSubject, Strbody, Enums.Enum_Confirmation_Mail_type.order); //objCommon.SendMail(objDataTable.Rows[0][tblOrder.ColumnNames.AppRecevierEmail].ToString(), strSubject, Strbody); string strText = ""; if (Convert.ToInt32(objDataTable.Rows[0][tblOrder.ColumnNames.AppPaymentMode].ToString()) == Convert.ToInt32(Enums.PaymentMode.COD)) { strText = appFunctions.strOrderShipped; } else { strText = appFunctions.strOrderShipped; } strText = strText.Replace("`uname`", objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverName].ToString()); strText = strText.Replace("`orderno`", objDataTable.Rows[0][tblOrder.ColumnNames.AppOrderNo].ToString()); strText = strText.Replace("`couriername`", objDataTable.Rows[0][tblCourierCompany.ColumnNames.AppCourierCompany].ToString()); strText = strText.Replace("`trackingno`", objDataTable.Rows[0][tblSubOrder.ColumnNames.AppDocketNo].ToString()); objCommon.SendOrderSMS(strText, objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverContactNo1].ToString()); objCommon = null; } objOrder = null; } catch (Exception ex) { Response.Write(ex.StackTrace.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["TenDangNhap"]) == "") Response.Redirect("~/dangnhap.aspx"); kqtDAL = new clsKetQuaThi_DAL(); kqtDTO = new clsKetQuaThi_DTO(); thisinhDAL = new clsThiSinh_DAL(); thisinhDTO = new clsThiSinh_DTO(); cmn = new clsCommon(); if (!IsPostBack || !IsCallback) { } if (!Page.IsPostBack) { } loadMasterData(); gvKetQuaThi.DataSource = loadDataToUI(); gvKetQuaThi.DataBind(); }
/// <summary> /// /// </summary> /// <param name="Uni_ID"></param> /// <param name="Fac_ID"></param> /// <param name="Cr_ID"></param> /// <param name="Molrn_ID"></param> /// <param name="Ptrn_ID"></param> private void FillBranch(long Uni_ID, string Inst_ID, long Fac_ID, long Cr_ID, long Molrn_ID, long Ptrn_ID) { DD_Branch.Items.Clear(); DT = new DataTable(); if (Inst_ID != string.Empty) { DT = oInst.AssignedConfirmedBranches(Convert.ToString(Uni_ID), Inst_ID, Convert.ToString(Fac_ID), Convert.ToString(Cr_ID), Convert.ToString(Molrn_ID), Convert.ToString(Ptrn_ID)); } else { DT = oCr.ListCourseModeOfLearningPatternWiseLaunchedBranches(Uni_ID, Fac_ID, Cr_ID, Molrn_ID, Ptrn_ID); } if (DT.Rows.Count > 0) { oCommon = new clsCommon(); if (DT.Rows.Count == 1) { if (Convert.ToString(DT.Rows[0]["Text"]).ToUpper() == "NO BRANCH") { ListItem li = new ListItem(); li.Text = "No Branch Available"; li.Value = "0"; DD_Branch.Items.Add(li); FillCoursePart(Uni_ID, pk_Institute_ID, Fac_ID, Cr_ID, Molrn_ID, Ptrn_ID, 0); } else { oCommon.fillDropDown(DD_Branch, DT, "-1", "Text", "Value", "---- Select ----"); } } else { oCommon.fillDropDown(DD_Branch, DT, "-1", "Text", "Value", "---- Select ----"); } if (oCommon != null) { oCommon = null; } } else { if (DD_Course.SelectedIndex == 0) { ListItem li = new ListItem(); li.Text = "---- Select ----"; li.Value = "-1"; DD_Branch.Items.Add(li); } else { ListItem li = new ListItem(); li.Text = "No Branch Available"; li.Value = "0"; DD_Branch.Items.Add(li); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { clsCommon cl = new clsCommon(); string RodName = cl.GetRodName(HttpContext.Current); string EpebType = cl.GetEpebType(HttpContext.Current); string EpebNo = cl.GetEpebNo(HttpContext.Current); if (RodName == "" || EpebType == "" || EpebNo == "") { LblNoData.Text = "Your session has expired, please try again!"; LblNoData.Visible = true; imgProcess.Visible = false; lblPrint.Visible = false; btnprint.Visible = false; return; } if (RodName == null || EpebType == null || EpebNo == null) { LblNoData.Text = "Your session has expired, please try again!"; LblNoData.Visible = true; imgProcess.Visible = false; lblPrint.Visible = false; btnprint.Visible = false; return; } string path = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings["Path"].ToString()); string strTextFile = System.Configuration.ConfigurationManager.AppSettings["txtFileName"].ToString(); string RodId = cl.GetRodId(HttpContext.Current); if (clsCommon.GetInfo4XML(path, strTextFile, RodId) == true) { } else { LblNoData.Text = "Data for selected Registry of deeds is not available, please try later!"; LblNoData.Visible = true; imgProcess.Visible = false; lblPrint.Visible = false; btnprint.Visible = false; return; } switch (EpebType) { case "CCV": imgProcess.ImageUrl = "~/LRA_Images/CCV.JPG"; //imgProcess.Height = 100; break; case "Chattel Mortgage": imgProcess.ImageUrl = "~/LRA_Images/CM.JPG"; break; case "Personal Properties": imgProcess.ImageUrl = "~/LRA_Images/PP.JPG"; break; case "Provisional Registration": imgProcess.ImageUrl = "~/LRA_Images/RL.JPG"; break; case "Registered Land": imgProcess.ImageUrl = "~/LRA_Images/RL.JPG"; break; case "Unregistered Land": imgProcess.ImageUrl = "~/LRA_Images/UL.JPG"; break; case "CARP Book": imgProcess.ImageUrl = "~/LRA_Images/RL_CARP.JPG"; break; } try { DataSet ds = new DataSet();//this dataset to read XML to datagrid string fileLocation = cl.GetNewPath(HttpContext.Current); Session["tableF"] = null; if (fileLocation == "" || fileLocation == null) { LblNoData.Text = "Unable to get information, please try after sometime!"; LblNoData.Visible = true; btnprint.Visible = false; imgProcess.Visible = false; lblPrint.Visible = false; btnprint.Visible = false; return; } //string fileName = fileLocation + "\\TransactionStatus.xml"; string fileName = fileLocation + "\\" + RodId + ".xml"; XPathDocument doc = new XPathDocument(fileName); XPathNavigator nav = doc.CreateNavigator(); // Compile a standard XPath expression XPathExpression expr; expr = nav.Compile("/NewDataSet/Table[RoD_Name='" + RodName + "']|/NewDataSet/Table[EPEB_Type_Desc='" + EpebType + "']|/NewDataSet/Table[EPEB_ENO='" + EpebNo + "']"); XPathNodeIterator iterator = nav.Select(expr); try { if (iterator.Count > 0) { while (iterator.MoveNext()) { XPathNavigator nav2 = iterator.Current.Clone(); nav2.MoveToFirstChild(); string a = nav2.Value; nav2.MoveToNext(); string b = nav2.Value; nav2.MoveToNext(); string c = nav2.Value; nav2.MoveToNext(); string d = nav2.Value; if (a == RodName && b == EpebType && c == EpebNo) { IFormatter formatter = new BinaryFormatter(); DataTable table = new DataTable(); //byte[] bt = Encoding.ASCII.GetBytes(iterator.Current.OuterXml); //MemoryStream ms = new MemoryStream(); //formatter.Serialize(ms, iterator.Current.OuterXml); StringReader stream = new StringReader(iterator.Current.OuterXml); XmlTextReader reader = new XmlTextReader(stream); ds.ReadXml(reader); //ds.ReadXml(ms); GridView1.DataSource = ds; Session["tableF"] = ds.Tables[0]; GridView1.DataBind(); #region Added Riyaz /* This Code Added in 04/07/2011 because of CRF_OTM_02_01 */ if (ds.Tables[0].Rows[0]["Activity_ID"].ToString().ToUpper() == "CLOSED") { GridView1.HeaderRow.Cells[5].Text = "Closed Date"; } else if (ds.Tables[0].Rows[0]["Activity_ID"].ToString().ToUpper() == "WITHDRAWN") { GridView1.HeaderRow.Cells[5].Text = "Withdrawn Date"; } else if (ds.Tables[0].Rows[0]["Activity_ID"].ToString().ToUpper() == "VOIDED") { GridView1.HeaderRow.Cells[5].Text = "Voided Date"; } else { GridView1.Columns[5].Visible = false; } #endregion GridView1.Visible = true; PnlGrid.Visible = true; //FileAttributes fileAttributes = File.GetAttributes(fileLocation + "\\TransactionStatus.xml"); //FileInfo f = new FileInfo(fileLocation + "\\TransactionStatus.xml"); //FileAttributes fileAttributes = File.GetAttributes(fileLocation + "\\" + RodId + ".xml"); //FileInfo f = new FileInfo(fileLocation + "\\" + RodId + ".xml"); //Lbldate.Text = f.LastWriteTime.ToLongDateString().Trim(); //LblTime.Text = f.LastWriteTime.ToShortTimeString().Trim(); DataSet ds1 = new DataSet(); ds1.ReadXml(fileLocation + "\\ExtractTime.xml"); Lbldate.Text = ds1.Tables[0].Rows[0][0].ToString().Trim(); Lbldate.Visible = true; LblTime.Visible = false; Lblcreatedate.Visible = true; //Label1.Visible = true; btnprint.Visible = true; LblNoData.Visible = false; imgProcess.Visible = true; lblPrint.Visible = true; break; } else { GridView1.DataSource = null; GridView1.DataBind(); LblNoData.Text = "Data Not Available. Please Check your entry!"; LblNoData.Visible = true; imgProcess.Visible = false; Lbldate.Visible = false; LblTime.Visible = false; Lblcreatedate.Visible = false; //Label1.Visible = false; btnprint.Visible = false; lblPrint.Visible = false; } } } else { GridView1.DataSource = null; GridView1.DataBind(); LblNoData.Text = "Data Not Available. Please Check your entry!"; LblNoData.Visible = true; imgProcess.Visible = false; Lbldate.Visible = false; LblTime.Visible = false; Lblcreatedate.Visible = false; //Label1.Visible = false; btnprint.Visible = false; lblPrint.Visible = false; } } catch { LblNoData.Text = "Unable to show data, please try after sometime!"; btnprint.Visible = false; imgProcess.Visible = false; LblNoData.Visible = true; imgProcess.Visible = false; lblPrint.Visible = false; } #region reading xml file by ReadXML --- not in use due to performance issue //ds.ReadXml(Server.MapPath("~\\XML\\TransactionStatus.xml")); //ds.ReadXml(fileLocation + "\\TransactionStatus.xml"); //try //{ // DataRow[] rows = ds.Tables[0].Select("RoD_Name = '" + RodName + "' and EPEB_Type_Desc = '" + EpebType + "' and EPEB_ENO = '" + EpebNo + "'"); // if (rows.Length > 0) // { // imgProcess.Visible = true; // LblNoData.Visible = false; // DataTable table = new DataTable(); // table = ds.Tables[0].Clone(); // DataRow row = table.NewRow(); // foreach (DataRow r in rows) // { // row["RoD_Name"] = r["RoD_Name"]; // row["EPEB_Type_Desc"] = r["EPEB_Type_Desc"]; // row["EPEB_ENO"] = r["EPEB_ENO"]; // row["Activity_ID"] = r["Activity_ID"]; // table.Rows.Add(row); // } // GridView1.DataSource = table; // Session["tableF"]=table; // GridView1.DataBind(); // GridView1.Visible = true; // PnlGrid.Visible = true; // FileAttributes fileAttributes = File.GetAttributes(fileLocation + "\\TransactionStatus.xml"); // FileInfo f = new FileInfo(fileLocation + "\\TransactionStatus.xml"); // Lbldate.Text = f.LastWriteTime.ToLongDateString().Trim(); // LblTime.Text = f.LastWriteTime.ToLongTimeString().Trim(); // Lbldate.Visible = true; // LblTime.Visible = true; // Lblcreatedate.Visible = true; // Label1.Visible = true; // } // else // { // GridView1.DataSource = null; // GridView1.DataBind(); // LblNoData.Text = "Data Not Available. Please Check your entry!"; // LblNoData.Visible = true; // imgProcess.Visible = false; // Lbldate.Visible = false; // LblTime.Visible = false; // Lblcreatedate.Visible = false; // Label1.Visible = false; // } //} //catch //{ // LblNoData.Text = "Unable to show data, please try after sometime!"; // LblNoData.Visible = true; // imgProcess.Visible = false; //} #endregion } catch { LblNoData.Text = "Unable to retrive data, please try after sometime!"; btnprint.Visible = false; imgProcess.Visible = false; LblNoData.Visible = true; imgProcess.Visible = false; } } }
public ActionResult InsertData(clsCommon cls) { tblProject project = new tblProject(); if (cls != null) { if (cls.intProjectId > 0) { var projectdata = (from data in db.tblProjects where data.ProjectId == cls.intProjectId select data).FirstOrDefault(); if (projectdata != null) { var duplicate = (from data in db.tblProjects where data.ProjectId != cls.intProjectId && cls.strProjectName == data.ProjectName.Trim() select data).FirstOrDefault(); if (duplicate != null) { cls.response = "exist"; } else { projectdata.ProjectName = cls.strProjectName; if (cls.file != null) { var fileName = Path.GetFileName(cls.file.FileName); var ext = Path.GetExtension(cls.file.FileName); string myfile = fileName + "_" + DateTime.Now.ToString("dd/MM/yyyy") + ext; var path = System.Web.HttpContext.Current.Server.MapPath("~/Image/" + myfile); cls.file.SaveAs(path); projectdata.ProjectLogo = myfile; } if (cls.strDate != null) { projectdata.DevelopementStartDate = DateTime.ParseExact(cls.strDate, "dd/MM/yyyy", CultureInfo.InvariantCulture); } db.SubmitChanges(); cls.response = "Update"; } } } else { var duplicate = (from data in db.tblProjects where cls.strProjectName == data.ProjectName.Trim() select data).FirstOrDefault(); if (duplicate != null) { cls.response = "exist"; } else { project.ProjectName = cls.strProjectName; if (cls.file != null) { var fileName = Path.GetFileName(cls.file.FileName); var ext = Path.GetExtension(cls.file.FileName); string myfile = fileName + "_" + DateTime.Now.ToString("dd/MM/yyyy") + ext; var path = System.Web.HttpContext.Current.Server.MapPath("~/Image/" + myfile); cls.file.SaveAs(path); project.ProjectLogo = myfile; } if (cls.strDate != null) { project.DevelopementStartDate = DateTime.ParseExact(cls.strDate, "dd/MM/yyyy", CultureInfo.InvariantCulture); } project.IsActive = true; db.tblProjects.InsertOnSubmit(project); db.SubmitChanges(); cls.response = "Insert"; } } } return(Json(cls.response, JsonRequestBehavior.AllowGet)); }
private bool SaveData() { objMenuItem = new tblMenuItem(); objCommon = new clsCommon(); if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objMenuItem.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objMenuItem.AddNew(); objMenuItem.AppCreatedDate = System.DateTime.Now; objMenuItem.AppCreatedBy = Convert.ToInt32(Session[appFunctions.Session.UserID.ToString()]); } if (chkCreatePage.Checked) { string strPageAlias = ""; int intPageID = 0; objPage = new tblPage(); if (rdbEditExisting.Checked) { objPage.LoadByPrimaryKey(Convert.ToInt32(hdnPageId.Value)); strPageAlias = txtNewPageAlias.Text; intPageID = Convert.ToInt32(hdnPageId.Value); } else if (rdbUseExistingPage.Checked && txtMenuPageAlias.Text != "") { objPage.LoadByPrimaryKey(Convert.ToInt32(ddlPages.SelectedValue)); strPageAlias = txtMenuPageAlias.Text; intPageID = Convert.ToInt32(ddlPages.SelectedValue); } else if (rdbUseExistingPage.Checked && txtMenuPageAlias.Text == "") { objMenuItem.s_AppPageId = ddlPages.SelectedValue; goto saveMenuItem; } else if (rdbCreateNewPage.Checked) { objPage.AddNew(); objPage.s_AppCreatedBy = Session[appFunctions.Session.UserID.ToString()].ToString(); strPageAlias = txtNewPageAlias.Text; objPage.AppCreatedDate = DateTime.Now; } ; if (rdbCreateNewPage.Checked || rdbEditExisting.Checked) { if (checkPage(txtPageName.Text, false, intPageID) != true) { DInfo.ShowMessage("The Page name already exists!!", Enums.MessageType.Error); return(false); } } if (checkPage(strPageAlias, true, intPageID) != true) { DInfo.ShowMessage("The Page alias already exists!!", Enums.MessageType.Error); return(false); } if (rdbCreateNewPage.Checked || rdbEditExisting.Checked) { if (chkIsDefault.Checked) { tblPage objPageTemp = new tblPage(); objPageTemp.ResetDefaultPage(); objPageTemp = null; objPage.AppIsDefault = chkIsDefault.Checked; } else { objPage.AppIsDefault = false; } objPage.AppIsLink = chkIsLink.Checked; if (chkIsLink.Checked) { objPage.AppLinkURL = txtLinkURL.Text; objPage.AppIsOpenInNewTab = chkIsOpenInNewTab.Checked; objPage.AppPageFormatId = 0; } else { objPage.s_AppPageFormatId = ddlPageFormats.SelectedValue; objPage.AppLinkURL = ""; objPage.AppIsOpenInNewTab = false; } objPage.AppPageContent = txtDescription.Text; objPage.AppPageHeading = txtPageHeader.Text; objPage.AppPageName = txtPageName.Text; objPage.AppPageTitle = txtPageTitle.Text; objPage.AppSEODescription = txtSEODescription.Text; objPage.AppSEOWord = txtSEOWord.Text; objPage.s_AppDynamicParameters = CkEditorDynParameters.Text; } strPageAlias = strPageAlias.Replace(" ", "-"); if (chkIsStatic.Checked) { objPage.AppAlias = strPageAlias; } else { objPage.AppAlias = strPageAlias + "/{*name}"; } objPage.Save(); objMenuItem.AppPageId = objPage.AppPageId; } else { objMenuItem.AppPageId = 0; } saveMenuItem: if (ChkIsActive.Checked) { objMenuItem.AppIsActive = true; } else { objMenuItem.AppIsActive = false; } objMenuItem.s_AppMenuItemTypeID = ddlMenuItemType.SelectedValue; objMenuItem.s_AppMenuItem = txtMenuItemName.Text; objMenuItem.s_AppParentId = ddlParent.SelectedValue; objMenuItem.s_AppMenuTypeId = ddlMenuType.SelectedValue; if (hdnPKID.Value == "") { objMenuItem.AppDisplayOrder = objCommon.GetNextDisplayOrder("tblMenuItem", tblMenuItem.ColumnNames.AppDisplayOrder, "appMenuTypeId = " + objMenuItem.AppMenuTypeId.ToString() + " and appParentID = " + objMenuItem.AppParentId.ToString()); } objMenuItem.Save(); iMenuItemid = objMenuItem.AppMenuItemId; objMenuItem = null; objCommon = null; return(true); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { lnkSaveAndAddnew.Visible = HasAdd; if (!((bool)Session[appFunctions.Session.IsSuperAdmin.ToString()])) { trDefaultPage.Visible = false; trIsStatic.Visible = false; trdynParameters.Visible = false; } hdnAliasPrefix.Value = ""; objCommon = new clsCommon(); objCommon.FillDropDownList(ddlMenuType, "tblMenuType", tblMenuType.ColumnNames.AppMenuTypeName, tblMenuType.ColumnNames.AppMenuTypeId, "-- Select Menu --", tblMenuType.ColumnNames.AppMenuTypeName, appFunctions.Enum_SortOrderBy.Asc); objCommon.FillDropDownList(ddlPages, "tblPage", tblPage.ColumnNames.AppPageName, tblPage.ColumnNames.AppPageId, "-- Select Page --", tblPage.ColumnNames.AppPageName, appFunctions.Enum_SortOrderBy.Asc); objCommon.FillDropDownList(ddlPageFormats, "tblPageFormat", tblPageFormat.ColumnNames.AppPageFormatName, tblPageFormat.ColumnNames.AppPageFormatId, "-- Select Page Format --", tblPageFormat.ColumnNames.AppPageFormatId, appFunctions.Enum_SortOrderBy.Asc, " appIsActive = 'true' "); objCommon.FillDropDownList(ddlMenuItemType, "tblMenuItemType", tblMenuItemType.ColumnNames.AppMenuItemType, tblMenuItemType.ColumnNames.AppMenuItemTypeID, "--Select Menu Item Type--"); if (ddlMenuType.SelectedIndex == 0) { ddlParent.Items.Add(new ListItem("--Select Parent--", "0")); } if ((Request.QueryString.Get("ID") != null)) { objEncrypt = new clsEncryption(); try { hdnPKID.Value = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey); } catch (Exception ex) { // noIdFoundRedirect("Employee.aspx"); } objEncrypt = null; SetValuesToControls(); } else { chkCreatePage.Checked = true; chkIsLink.Checked = false; rdbCreateNewPage.Checked = true; rdbUseExistingPage.Checked = false; rdbUseExistingPage_CheckedChanged(null, null); CheckCreatePage(true); chkIsStatic.Checked = true; } CheckLink(chkIsLink.Checked); if ((Request.QueryString.Get("TID") != null)) { objEncrypt = new clsEncryption(); try { hdnMenuTypeId.Value = objEncrypt.Decrypt(Request.QueryString.Get("TID"), appFunctions.strKey); hdnPageName.Value = Request.QueryString.Get("Page"); } catch (Exception ex) { // noIdFoundRedirect("Employee.aspx"); } ddlMenuType.SelectedValue = objEncrypt.Decrypt(Request.QueryString.Get("TID"), appFunctions.strKey); ddlMenuType_SelectedIndexChanged(null, null); objEncrypt = null; } else if ((Request.QueryString.Get("PID") != null)) { objEncrypt = new clsEncryption(); try { strSiteMapId = Convert.ToInt32(objEncrypt.Decrypt(Request.QueryString.Get("PID"), appFunctions.strKey)); } catch (Exception ex) { // noIdFoundRedirect("Employee.aspx"); } tblMenuItem objTemp = new tblMenuItem(); objTemp.Query.AddResultColumn(tblMenuItem.ColumnNames.AppMenuTypeId); objTemp.Where.AppMenuItemId.Value = objEncrypt.Decrypt(Request.QueryString.Get("PID"), appFunctions.strKey); objTemp.Query.Load(); if (objTemp.RowCount > 0) { hdnMenuTypeId.Value = objTemp.s_AppMenuTypeId; ddlMenuType.SelectedValue = objTemp.s_AppMenuTypeId; ddlMenuType_SelectedIndexChanged(null, null); } try { ddlParent.SelectedValue = objEncrypt.Decrypt(Request.QueryString.Get("PID"), appFunctions.strKey).ToString(); } catch (Exception ex) { // noIdFoundRedirect("Employee.aspx"); } objEncrypt = null; } if ((Request.QueryString.Get("ID") != null)) { objEncrypt = new clsEncryption(); try { strSiteMapId = Convert.ToInt32(objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey)); } catch (Exception ex) { // noIdFoundRedirect("Employee.aspx"); } objEncrypt = null; } if (Request.QueryString.Get("ID") != null || Request.QueryString.Get("PID") != null || Request.QueryString.Get("TID") != null) { GenerateAlias(strSiteMapId); } SetRegulerExpression(); } }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["TenDangNhap"]) == "") Response.Redirect("~/dangnhap.aspx"); lchoiDAL = new clsLoaiCauHoi_DAL(); lchoiDTO = new clsLoaiCauHoi_DTO(); choiDAL = new clsCauHoi_DAL(); choiDTO = new clsCauHoi_DTO(); clchonDAL = new clsCauLuaChon_DAL(); clchonDTO = new clsCauLuaChon_DTO(); choi_clchonDAL = new clsCauHoi_CauLuaChon_DAL(); choi_clchonDTO = new clsCauHoi_CauLuaChon_DTO(); ctchoiDAL = new clsChiTietCauHoi_DAL(); cmn = new clsCommon(); loadMasterData(); }