private void btnSave_Click(object sender, EventArgs e) { if (IsCorrectData()) { clsUsers users = new clsUsers(); users.Username = _strUsername; users.Fill(); users.Password = txtPassword.Text; users.LastName = txtLastname.Text; users.FirstName = txtFirstname.Text; users.MiddleName = txtMiddleName.Text; users.NickName = txtNickName.Text; users.Email = txtEmail.Text; users.BirthDate = dtpBirthDate.Value; users.Title = txtTitle.Text; users.Gender = cmbSex.SelectedValue.ToString(); users.Online = "0"; users.LastLog = DateTime.Now; users.UserClass = "H"; users.Status = cmbStatus.SelectedValue.ToString(); users.Update(); _frmPortalUsersList.BindUsersList(); this.Close(); } }
private void BindDetails() { DataTable tblSex = new DataTable(); tblSex.Columns.Add(new DataColumn("pvalue")); tblSex.Columns.Add(new DataColumn("ptext")); DataRow drw = tblSex.NewRow(); drw["pvalue"] = "M"; drw["ptext"] = "Male"; tblSex.Rows.Add(drw); drw = tblSex.NewRow(); drw["pvalue"] = "F"; drw["ptext"] = "Female"; tblSex.Rows.Add(drw); cmbSex.DataSource = tblSex; cmbSex.ValueMember = "pvalue"; cmbSex.DisplayMember = "ptext"; cmbStatus.DataSource = clsUsers.GetDSLStatus(); cmbStatus.ValueMember = "pvalue"; cmbStatus.DisplayMember = "ptext"; txtUsername.Text = _strUsername; using (clsUsers user = new clsUsers()) { user.Username = _strUsername; user.Fill(); txtPassword.Text = user.Password; txtLastname.Text = user.LastName; txtFirstname.Text = user.FirstName; txtMiddleName.Text = user.MiddleName; txtNickName.Text = user.NickName; txtEmail.Text = user.Email; dtpBirthDate.Value = user.BirthDate; txtTitle.Text = user.Title; cmbSex.SelectedValue = user.Gender; cmbStatus.SelectedValue = user.Status; } }
protected void Page_Load(object sender, EventArgs e) { clsSpeedo.Authenticate(); if (!Page.IsPostBack) { if (clsEmployee.GetDepartmentCode(Request.Cookies["Speedo"]["UserName"]) == "023") { //bool blnReadOnly; txtMrcfCode.Text = Request.QueryString["mrcfcode"].ToString(); txtProcMngrName.Text = clsUsers.GetName(Request.Cookies["Speedo"]["UserName"]); clsMRCF mrcf = new clsMRCF(txtMrcfCode.Text); mrcf.Fill(); hdnRequestor.Value = mrcf.Username; txtReqType.Text = mrcf.RequestTypeDesc; txtDateReq.Text = mrcf.DateRequested.ToString("MMMM dd, yyyy"); txtIntended.Text = mrcf.Intended; hdnChargeTo.Value = mrcf.ChargeTo; hdnGrpHeadCode.Value = mrcf.GroupHead; txtGrpHeadRem.Text = mrcf.GroupHeadRemarks; hdnGrpHeadStat.Value = mrcf.GroupHeadStatus; hdnDiviHeadCode.Value = mrcf.DivisionHead; txtDiviHeadRem.Text = mrcf.DivisionHeadRemarks; hdnDiviHeadStat.Value = mrcf.DivisionHeadStatus; hdnProcMngrCode.Value = mrcf.ProcurementManager; txtProcMngrRem.Text = mrcf.ProcurementManagerRemarks; hdnProcMngrStat.Value = mrcf.ProcurementManagerStatus; txtStat.Text = mrcf.StatusDescription; //blnReadOnly = (hdnProcMngrStat.Value == "F" ? false : true); txtRCName.Text = clsEmployee.GetRCName(hdnRequestor.Value); txtChargeTo.Text = clsRC.GetRCName(hdnChargeTo.Value); using (clsUsers users = new clsUsers()) { users.Username = hdnRequestor.Value; users.Fill(); txtRequestorName.Text = users.FullName; hdnRequestorMail.Value = users.Email; users.Username = hdnGrpHeadCode.Value; users.Fill(); txtGrpHeadName.Text = users.FullName; hdnGrpHeadMail.Value = users.Email; users.Username = hdnDiviHeadCode.Value; users.Fill(); txtDiviHeadName.Text = users.FullName; hdnDiviHeadMail.Value = users.Email; } BindItems(); //divButtons.Visible = !blnReadOnly; //divButtons2.Visible = !blnReadOnly; //divSave.Visible = blnReadOnly; // txtProcMngrRem.ReadOnly = blnReadOnly; // if (blnReadOnly) // txtProcMngrRem.BackColor = System.Drawing.Color.FromName("#f0f8ff"); } else { Response.Redirect("~/AccessDenied.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { clsSpeedo.Authenticate(); if (!Page.IsPostBack) { string strProcessScript = "this.value='Processing...';this.disabled=true;"; btnSavePost.Attributes.Add("onclick", strProcessScript + ClientScript.GetPostBackEventReference(btnSavePost, "").ToString()); clsMRCF.AuthenticateUser(clsMRCF.MRCFUserType.Requestor, Request.Cookies["Speedo"]["UserName"].ToString(), Request.QueryString["mrcfcode"].ToString()); MakeCart(); bool blnReadOnly = false; DataTable tblAsset = new DataTable(); DataTable tblRequestType = new DataTable(); txtMRCFCode.Text = Request.QueryString["mrcfcode"].ToString(); txtRequestorName.Text = clsUsers.GetName(Request.Cookies["Speedo"]["UserName"].ToString()); clsMRCF mrcf = new clsMRCF(txtMRCFCode.Text); mrcf.Fill(); txtIntended.Text = mrcf.Intended; hdnChargeTo.Value = mrcf.ChargeTo; txtChargeTo.Text = clsRC.GetRCName(hdnChargeTo.Value); ddlType.SelectedValue = mrcf.RequestType; txtDateReq.Text = mrcf.DateRequested.ToString("MMMM dd, yyyy"); hdnGrpHeadCode.Value = mrcf.GroupHead; txtGrpHeadRem.Text = mrcf.GroupHeadRemarks; hdnDiviHeadCode.Value = mrcf.DivisionHead; txtDiviHeadRem.Text = mrcf.DivisionHeadRemarks; hdnProcMngrCode.Value = mrcf.ProcurementManager; txtProcMngrRem.Text = mrcf.ProcurementManagerRemarks; hdnStatus.Value = mrcf.Status; txtStat.Text = mrcf.StatusDescription; blnReadOnly = (mrcf.Status == "M" ? false : true); using (clsUsers users = new clsUsers()) { users.Username = hdnGrpHeadCode.Value; users.Fill(); txtGrpHeadName.Text = users.FullName; hdnGrpHeadMail.Value = users.Email; users.Username = hdnDiviHeadCode.Value; users.Fill(); txtDiviHeadName.Text = users.FullName; hdnDiviHeadMail.Value = users.Email; users.Username = hdnProcMngrCode.Value; users.Fill(); txtProcMngrName.Text = users.FullName; hdnProcMngrMail.Value = users.Email; } ddlLineType.DataSource = clsMrcfLineType.GetDataSourceListLineType(clsEmployee.GetDepartmentCode(Request.Cookies["Speedo"]["UserName"])).DefaultView; ddlLineType.DataBind(); ddlLineType.Items[0].Selected = true; if (clsMrcfLineType.IsHasItemCode(ddlLineType.SelectedValue.ToString()) == true) { trItems.Visible = true; if (ddlLineType.SelectedValue.ToString() == "1") { trItemsCategory.Visible = false; } else { trItemsCategory.Visible = true; } } else { trItems.Visible = false; } LoadPrimaryItemCategory(); ddlTransactionType.DataSource = clsMRCFTransactionType.GetDataSourceList(ddlLineType.SelectedValue.ToString()).DefaultView; ddlTransactionType.DataBind(); ddlTransactionType.Items[0].Selected = true; ddlItem.DataSource = clsOracleMrcf.GetDataSourceListItems(ddlLineType.SelectedValue.ToString(), ddlItemCategory.SelectedValue.ToString()); ddlItem.DataBind(); LoadUnitAll(); ddlType.DataSource = clsMRCF.GetDDLSourceMrcfRequestType().DefaultView; ddlType.DataValueField = "pValue"; ddlType.DataTextField = "pText"; ddlType.DataBind(); DateTime dteDate = clsMRCF.GetMinimumDateNeeded(ddlType.SelectedValue); dteDateNeeded.MinDate = dteDate; dteDateNeeded.Date = dteDate; BindItems(); pnlAddItem.Visible = !blnReadOnly; divButtons.Visible = !blnReadOnly; divButtons2.Visible = !blnReadOnly; ddlType.Enabled = !blnReadOnly; txtIntended.ReadOnly = blnReadOnly; if (blnReadOnly) { foreach (DataGridItem itm in dgItems.Items) { TextBox ptxtItemDesc = (TextBox)itm.FindControl("txtItemDesc"); TextBox ptxtItemSpec = (TextBox)itm.FindControl("txtItemSpec"); Label ptxtQty = (Label)itm.FindControl("lblQty"); GrayMatterSoft.GMDatePicker pdteDNeeded = (GrayMatterSoft.GMDatePicker)itm.FindControl("dteDNeeded"); ptxtItemDesc.ReadOnly = blnReadOnly; ptxtItemDesc.BackColor = System.Drawing.Color.FromName("#f0f8ff"); ptxtItemSpec.ReadOnly = blnReadOnly; ptxtItemSpec.BackColor = System.Drawing.Color.FromName("#f0f8ff"); ptxtQty.BackColor = System.Drawing.Color.FromName("#f0f8ff"); pdteDNeeded.Enabled = false; pdteDNeeded.BackColor = System.Drawing.Color.FromName("#f0f8ff"); } //dgItems.Columns[4].Visible = false; //txtIntended.BackColor = System.Drawing.Color.FromName("#f0f8ff"); //ddlType.BackColor = System.Drawing.Color.FromName("#f0f8ff"); } else { foreach (DataGridItem itm in dgItems.Items) { GrayMatterSoft.GMDatePicker pdteDNeeded = (GrayMatterSoft.GMDatePicker)itm.FindControl("dteDNeeded"); pdteDNeeded.MinDate = pdteDNeeded.Date; } } } }
protected void Page_Load(object sender, EventArgs e) { clsSpeedo.Authenticate(); if (!Page.IsPostBack) { bool blnReadOnly; clsRequisition.AuthenticateUser(clsRequisition.RequisitionUserType.DivisionHead, Request.Cookies["Speedo"]["UserName"].ToString(), Request.QueryString["requcode"].ToString()); txtRequCode.Text = Request.QueryString["requcode"]; txtDiviHeadName.Text = clsUsers.GetName(Request.Cookies["Speedo"]["UserName"]); using (clsRequisition requisition = new clsRequisition(txtRequCode.Text)) { requisition.Fill(); hdnRequestor.Value = requisition.Username; txtDateReq.Text = requisition.DateRequested.ToString(); txtRemarks.Text = requisition.Intended; hdnGrpHeadCode.Value = requisition.GroupHead; txtGrpHeadRem.Text = requisition.GroupHeadRemarks; hdnGrpHeadStatus.Value = requisition.GroupHeadStatus; txtDiviHeadRem.Text = requisition.DivisionHeadRemarks; blnReadOnly = (requisition.DivisionHeadStatus == "F" ? false : true); hdnSuppCode.Value = requisition.SuppliesCustodian; txtSuppRem.Text = requisition.SuppliesCustodianRemarks; txtStat.Text = requisition.StatusDescription; hdnChargeTo.Value = requisition.ChargeTo; } txtRCName.Text = clsEmployee.GetRCName(hdnRequestor.Value); txtChargeTo.Text = clsRC.GetRCName(hdnChargeTo.Value); using (clsUsers users = new clsUsers()) { users.Username = hdnRequestor.Value; users.Fill(); txtRequestorName.Text = users.FullName; hdnRequestorMail.Value = users.Email; users.Username = hdnGrpHeadCode.Value; users.Fill(); txtGrpHeadName.Text = users.FullName; hdnGrpHeadMail.Value = users.Email; users.Username = hdnSuppCode.Value; users.Fill(); txtSuppName.Text = users.FullName; hdnSuppMail.Value = users.Email; } txtChargeToBudget.Text = "P " + clsRequisition.GetCurrentBudget(hdnChargeTo.Value).ToString("#,###,##0.00"); BindItems(); HasEnoughBudget(); divButton.Visible = !blnReadOnly; divButtons2.Visible = !blnReadOnly; divBudget.Visible = !blnReadOnly; txtDiviHeadRem.ReadOnly = blnReadOnly; txtRemarks.ReadOnly = blnReadOnly; if (blnReadOnly) { txtDiviHeadRem.BackColor = System.Drawing.Color.FromName("#f0f8ff"); txtRemarks.BackColor = System.Drawing.Color.FromName("#f0f8ff"); dgItems.Columns[5].Visible = false; //foreach (DataGridItem itm in dgItems.Items) //{ // TextBox ptxtQty = (TextBox)itm.FindControl("txtQty"); // ptxtQty.ReadOnly = blnReadOnly; // ptxtQty.BackColor = System.Drawing.Color.FromName("#f0f8ff"); //} } } }
protected void LoadApprover(string strRCCode) { //using (SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["Speedo"].ToString())) //{ // DataTable tblGroupHead = new DataTable(); // SqlCommand cmd = cn.CreateCommand(); // cmd.CommandText = "SELECT username,firname + ' ' + lastname AS name,email FROM Users.Users WHERE username IN (SELECT username FROM CIS.RequisitionApprover WHERE rccode='" + strRCCode + "' AND pstatus='1' AND userlvl='sprv') ORDER BY firname"; // cn.Open(); // SqlDataAdapter da = new SqlDataAdapter(cmd); // da.Fill(tblGroupHead); // ddlGrpHead.DataSource = tblGroupHead; // ddlGrpHead.DataValueField = "username"; // ddlGrpHead.DataTextField = "name"; // ddlGrpHead.DataBind(); // if (ddlGrpHead.Items.Count == 0) // { // ListItem itm = new ListItem("No Approver Defined", "none"); // ddlGrpHead.Items.Add(itm); // } // cmd.CommandText = "SELECT username,firname + ' ' + lastname AS name,email FROM Users.Users WHERE username IN (SELECT username FROM CIS.RequisitionApprover WHERE rccode='" + strRCCode + "' AND pstatus='1' AND userlvl='head')"; // SqlDataReader dr = cmd.ExecuteReader(); // if (dr.Read()) // { // btnSave.Enabled = true; // hdnDiviHeadCode.Value = dr["username"].ToString(); // hdnDiviHeadMail.Value = dr["email"].ToString(); // txtDiviHeadName.Text = dr["name"].ToString(); // } // else // { // btnSave.Enabled = false; // hdnDiviHeadCode.Value = ""; // hdnDiviHeadMail.Value = ""; // txtDiviHeadName.Text = "[No Approver Defined]"; // } // dr.Close(); //} //DataTable tblGroupHeadApprover = clsMRCFApprover.DSLGroupHeadApprover(pRcCode); DataTable tblGroupHeadApprover = clsModuleApprover.DSLRCApprover(clsModule.RequisitionModule, "1", ddlChargeTo.SelectedValue.ToString()); ddlGrpHead.DataSource = tblGroupHeadApprover; ddlGrpHead.DataValueField = "pvalue"; ddlGrpHead.DataTextField = "ptext"; ddlGrpHead.DataBind(); if (ddlGrpHead.Items.Count == 0) { ddlGrpHead.Items.Add(new ListItem("No Approver Defined", "none")); } DataTable tblDivHeadApprover = clsModuleApprover.DSLRCApprover(clsModule.RequisitionModule, "2", ddlChargeTo.SelectedValue.ToString()); ddlDivision.DataSource = tblDivHeadApprover; ddlDivision.DataValueField = "pvalue"; ddlDivision.DataTextField = "ptext"; ddlDivision.DataBind(); if (ddlDivision.Items.Count == 0) { ddlDivision.Items.Add(new ListItem("No Approver Defined", "none")); } if (ddlDivision.SelectedValue.ToString() == "none" || ddlGrpHead.SelectedValue.ToString() == "none") { btnSave.Enabled = false; } else { btnSave.Enabled = true; //hdnDiviHeadCode.Value = ddlDivision.SelectedValue.ToString(); using (clsUsers users = new clsUsers()) { users.Username = ddlDivision.SelectedValue.ToString(); users.Fill(); hdnDiviHeadMail.Value = users.Email; } } }
protected void LoadApprover(string pRcCode) { //DataTable tblGroupHeadApprover = clsMRCFApprover.DSLGroupHeadApprover(pRcCode); DataTable tblGroupHeadApprover = clsModuleApprover.DSLRCApprover(clsModule.MRCFModule, "1", ddlChargeTo.SelectedValue.ToString()); ddlGrpHead.DataSource = tblGroupHeadApprover; ddlGrpHead.DataValueField = "pvalue"; ddlGrpHead.DataTextField = "ptext"; ddlGrpHead.DataBind(); if (ddlGrpHead.Items.Count == 0) { ddlGrpHead.Items.Add(new ListItem("No Approver Defined", "none")); } DataTable tblDivHeadApprover = clsModuleApprover.DSLRCApprover(clsModule.MRCFModule, "2", ddlChargeTo.SelectedValue.ToString()); ddlDivision.DataSource = tblDivHeadApprover; ddlDivision.DataValueField = "pvalue"; ddlDivision.DataTextField = "ptext"; ddlDivision.DataBind(); if (ddlDivision.Items.Count == 0) { ddlDivision.Items.Add(new ListItem("No Approver Defined", "none")); } if (ddlDivision.SelectedValue.ToString() == "none" || ddlGrpHead.SelectedValue.ToString() == "none") { btnSend.Enabled = false; } else { btnSend.Enabled = true; //hdnDiviHeadCode.Value = ddlDivision.SelectedValue.ToString(); using (clsUsers users = new clsUsers()) { users.Username = ddlDivision.SelectedValue.ToString(); users.Fill(); hdnDiviHeadMail.Value = users.Email; } } //string strDHApprover = clsMRCFApprover.GetDivisionHeadApprover(pRcCode); //if (strDHApprover != "") //{ // btnSend.Enabled = true; // hdnDiviHeadCode.Value = strDHApprover; // using (clsUsers users = new clsUsers()) // { // users.Username = strDHApprover; // users.Fill(); // txtDiviHeadName.Text = users.FullName; // hdnDiviHeadMail.Value = users.Email; // } //} //else //{ // btnSend.Enabled = false; // hdnDiviHeadCode.Value = ""; // txtDiviHeadName.Text = "[No Approver Defined]"; // hdnDiviHeadMail.Value = ""; //} }
protected void Page_Load(object sender, EventArgs e) { clsSpeedo.Authenticate(); // btnSend.Attributes.Add("onclick", "if(Page_ClientValidate()){this.disabled=true;" + btnSend.Page.ClientScript.GetPostBackEventReference(btnSend, string.Empty).ToString() + ";return CheckIsRepeat();}"); // bool blnReturn = IsConnectedToServer(); btnSend.Attributes.Add("onclick", " this.disabled = true; " + ClientScript.GetPostBackEventReference(btnSend, null) + ";"); // REMOVE DUE TO ORACLE DB is not available // By Calvin V.C // feb 13, 2018 //if (!clsOracleMrcf.IsOracleUp()) //{ // Response.Redirect("OracleDatabaseProblem.aspx"); //} if (!Page.IsPostBack) { LoadMonths(); LoadDays(); LoadAirlines(); LoadEmployees(); //trAirfare.Visible = false; trNoRequest.Visible = true; string strRCCode = ""; MakeCart(); txtRequestorName.Text = clsEmployee.GetName(Request.Cookies["Speedo"]["UserName"], EmployeeNameFormat.LastFirst); strRCCode = clsEmployee.GetRCCode(Request.Cookies["Speedo"]["UserName"]); string strProcessScript = "this.value='Processing...';this.disabled=true;"; btnSend.Attributes.Add("onclick", strProcessScript + ClientScript.GetPostBackEventReference(btnSend, "").ToString()); clsUsers users = new clsUsers(clsMRCFApprover.GetProcurementManager()); users.Fill(); txtProcMngrName.Text = users.FullName; hdnProcMngrMail.Value = users.Email; ddlLineType.DataSource = clsMrcfLineType.GetDataSourceListLineType(clsEmployee.GetDepartmentCode(Request.Cookies["Speedo"]["UserName"])).DefaultView; ddlLineType.DataBind(); ddlLineType.Items[0].Selected = true; if (clsMrcfLineType.IsHasItemCode(ddlLineType.SelectedValue.ToString()) == true) { trItems.Visible = true; if (ddlLineType.SelectedValue.ToString() == "1") { trItemsCategory.Visible = false; } else { trItemsCategory.Visible = true; } } else { trItems.Visible = false; } LoadPrimaryItemCategory(); ddlTransactionType.DataSource = clsMRCFTransactionType.GetDataSourceList(ddlLineType.SelectedValue.ToString()).DefaultView; ddlTransactionType.DataBind(); ddlTransactionType.Items[0].Selected = true; ddlItem.DataSource = clsOracleMrcf.GetDataSourceListItems(ddlLineType.SelectedValue.ToString(), ddlItemCategory.SelectedValue.ToString()); ddlItem.DataBind(); LoadUnitAll(); ddlType.DataSource = clsMRCF.GetDDLSourceMrcfRequestType().DefaultView; ddlType.DataValueField = "pValue"; ddlType.DataTextField = "pText"; ddlType.DataBind(); if (strRCCode != "") { LoadRC(strRCCode); } else { LoadRC(); } DateTime dteDate = clsMRCF.GetMinimumDateNeeded(ddlType.SelectedValue); dteDateNeeded.MinDate = dteDate; dteDateNeeded.Date = dteDate; if (!ValidateEmployee()) { return; } } }
protected void Page_Load(object sender, EventArgs e) { clsSpeedo.Authenticate(); divErr.Visible = false; if (!Page.IsPostBack) { string strProcessScript = "this.value='Processing...';this.disabled=true;"; btnApprove.Attributes.Add("onclick", strProcessScript + ClientScript.GetPostBackEventReference(btnApprove, "").ToString()); btnApprove2.Attributes.Add("onclick", strProcessScript + ClientScript.GetPostBackEventReference(btnApprove2, "").ToString()); // string strProcessScript = "this.value='Processing...';this.disabled=true;"; btnDisApprove.Attributes.Add("onclick", strProcessScript + ClientScript.GetPostBackEventReference(btnDisApprove, "").ToString()); btnDisapprove2.Attributes.Add("onclick", strProcessScript + ClientScript.GetPostBackEventReference(btnDisapprove2, "").ToString()); btnModification2.Attributes.Add("onclick", strProcessScript + ClientScript.GetPostBackEventReference(btnModification2, "").ToString()); btnModify.Attributes.Add("onclick", strProcessScript + ClientScript.GetPostBackEventReference(btnModify, "").ToString()); clsMRCF.AuthenticateUser(clsMRCF.MRCFUserType.GroupHead, Request.Cookies["Speedo"]["UserName"].ToString(), Request.QueryString["mrcfcode"].ToString()); bool blnReadOnly = false; txtMrcfCode.Text = Request.QueryString["mrcfcode"]; txtGrpHeadName.Text = clsUsers.GetName(Request.Cookies["Speedo"]["UserName"]); clsMRCF mrcf = new clsMRCF(txtMrcfCode.Text); mrcf.Fill(); hdnRequestor.Value = mrcf.Username; hdnReqType.Value = mrcf.RequestType; txtReqType.Text = mrcf.RequestTypeDesc; txtDateReq.Text = Convert.ToDateTime(mrcf.DateRequested).ToString("MMMM dd,yyyy"); txtIntended.Text = mrcf.Intended; hdnChargeTo.Value = mrcf.ChargeTo; hdnGrpHeadStat.Value = mrcf.GroupHeadStatus; txtGrpHeadRem.Text = mrcf.GroupHeadRemarks; hdnDiviHeadCode.Value = mrcf.DivisionHead; txtDiviHeadRem.Text = mrcf.DivisionHeadRemarks; hdnProcMngrCode.Value = mrcf.ProcurementManager; txtProcMngrRem.Text = mrcf.ProcurementManagerRemarks; txtStat.Text = mrcf.StatusDescription; blnReadOnly = (hdnGrpHeadStat.Value == "F" ? false : true); txtRCName.Text = clsEmployee.GetRCName(hdnRequestor.Value); txtChargeTo.Text = clsRC.GetRCName(hdnChargeTo.Value); using (clsUsers users = new clsUsers()) { users.Username = hdnRequestor.Value; users.Fill(); txtRequestorName.Text = users.FullName; hdnRequestorMail.Value = users.Email; users.Username = hdnDiviHeadCode.Value; users.Fill(); txtDiviHeadName.Text = users.FullName; hdnDiviHeadMail.Value = users.Email; users.Username = hdnProcMngrCode.Value; users.Fill(); txtProcMngrName.Text = users.FullName; hdnProcMngrMail.Value = users.Email; } BindItems(); divButtons.Visible = !blnReadOnly; divButtons2.Visible = !blnReadOnly; txtGrpHeadRem.ReadOnly = blnReadOnly; txtIntended.ReadOnly = blnReadOnly; if (blnReadOnly) { foreach (DataGridItem itm in dgItems.Items) { TextBox ptxtItemDesc = (TextBox)itm.FindControl("txtItemDesc"); TextBox ptxtItemSpec = (TextBox)itm.FindControl("txtItemSpec"); TextBox ptxtQty = (TextBox)itm.FindControl("txtQty"); GrayMatterSoft.GMDatePicker pdteDateNeeded = (GrayMatterSoft.GMDatePicker)itm.FindControl("dteDateNeeded"); ptxtItemDesc.ReadOnly = blnReadOnly; ptxtItemDesc.BackColor = System.Drawing.Color.FromName("#f0f8ff"); ptxtItemSpec.ReadOnly = blnReadOnly; ptxtItemSpec.BackColor = System.Drawing.Color.FromName("#f0f8ff"); ptxtQty.ReadOnly = blnReadOnly; ptxtQty.BackColor = System.Drawing.Color.FromName("#f0f8ff"); pdteDateNeeded.Enabled = false; pdteDateNeeded.BackColor = System.Drawing.Color.FromName("#f0f8ff"); } dgItems.Columns[4].Visible = false; txtIntended.BackColor = System.Drawing.Color.FromName("#f0f8ff"); txtGrpHeadRem.BackColor = System.Drawing.Color.FromName("#f0f8ff"); } else { foreach (DataGridItem itm in dgItems.Items) { GrayMatterSoft.GMDatePicker pdteDateNeeded = (GrayMatterSoft.GMDatePicker)itm.FindControl("dteDateNeeded"); pdteDateNeeded.MinDate = clsMRCF.GetMinimumDateNeeded(hdnReqType.Value, Convert.ToDateTime(txtDateReq.Text)); } } } }
protected void Page_Load(object sender, EventArgs e) { clsSpeedo.Authenticate(); if (!Page.IsPostBack) { bool blnReadOnly; clsRequisition.AuthenticateUser(clsRequisition.RequisitionUserType.Requestor, Request.Cookies["Speedo"]["UserName"].ToString(), Request.QueryString["requcode"].ToString()); MakeCart(); LoadPrimaryItemCategory(); LoadItems(ddlItemCategory.SelectedValue.ToString()); LoadItemDetails(); txtRequCode.Text = Request.QueryString["requcode"].ToString(); txtRequestorName.Text = clsUsers.GetName(Request.Cookies["Speedo"]["UserName"]); using (clsRequisition requisition = new clsRequisition(txtRequCode.Text)) { requisition.Fill(); txtDateReq.Text = requisition.DateRequested.ToString(); txtIntended.Text = requisition.Intended; hdnChargeTo.Value = requisition.ChargeTo; hdnGrpHeadCode.Value = requisition.GroupHead; txtGrpHeadRem.Text = requisition.GroupHeadRemarks; hdnDiviHeadCode.Value = requisition.DivisionHead; txtHeadRem.Text = requisition.DivisionHeadRemarks; hdnSuppCode.Value = requisition.SuppliesCustodian; txtSuppRem.Text = requisition.SuppliesCustodianRemarks; hdnStatus.Value = requisition.Status; txtStat.Text = requisition.StatusDescription; blnReadOnly = (hdnStatus.Value == "M" ? false : true); } txtChargeTo.Text = clsRC.GetRCName(hdnChargeTo.Value); using (clsUsers users = new clsUsers()) { users.Username = hdnGrpHeadCode.Value; users.Fill(); txtGrpHeadName.Text = users.FullName; hdnGrpHeadMail.Value = users.Email; users.Username = hdnDiviHeadCode.Value; users.Fill(); txtDiviHeadName.Text = users.FullName; hdnDiviHeadMail.Value = users.Email; users.Username = hdnSuppCode.Value; users.Fill(); txtSuppName.Text = users.FullName; hdnSuppMail.Value = users.Email; } txtIntended.ReadOnly = blnReadOnly; divButtons.Visible = !blnReadOnly; divAddItem.Visible = !blnReadOnly; divBudget.Visible = !blnReadOnly; BindItems(); if (blnReadOnly) { //foreach (DataGridItem itm in dgItems.Items) //{ // TextBox ptxtQty = (TextBox)itm.FindControl("txtQty"); // ptxtQty.ReadOnly = blnReadOnly; // ptxtQty.BackColor = System.Drawing.Color.FromName("#f0f8ff"); //} } else { // LoadItems(); HasEnoughBudget(); } if (blnReadOnly) { txtIntended.BackColor = System.Drawing.Color.FromName("#f0f8ff"); dgItems.Columns[6].Visible = false; } } }
protected void Page_Load(object sender, EventArgs e) { clsSpeedo.Authenticate(); if (!Page.IsPostBack) { BindItems(); BindEmployee(); BindAssignStatus(); string strProcessScript = "this.value='Processing...';this.disabled=true;"; btnUpdate.Attributes.Add("onclick", strProcessScript + ClientScript.GetPostBackEventReference(btnUpdate, "").ToString()); ddlType.DataSource = clsMRCF.GetDDLSourceMrcfRequestType().DefaultView; ddlType.DataValueField = "pValue"; ddlType.DataTextField = "pText"; ddlType.DataBind(); if (Request.QueryString["updatecode"] != null) { if (Request.QueryString["updatecode"].ToString() == "000") { DivUpdateStatus.Visible = false; divModal.Visible = false; } else { DivUpdateStatus.Visible = true; DivUpdateStatus.Visible = true; } } // clsMRCF.AuthenticateUser(clsMRCF.MRCFUserType.Requestor, Request.Cookies["Speedo"]["UserName"].ToString(), Request.QueryString["mrcfcode"].ToString()); bool blnReadOnly = false; DataTable tblAsset = new DataTable(); DataTable tblRequestType = new DataTable(); txtMRCFCode.Text = Request.QueryString["mrcfcode"].ToString(); txtRequestorName.Text = clsUsers.GetName(Request.Cookies["Speedo"]["UserName"].ToString()); clsMRCF mrcf = new clsMRCF(txtMRCFCode.Text); mrcf.Fill(); txtIntended.Text = mrcf.Intended; hdnChargeTo.Value = mrcf.ChargeTo; txtChargeTo.Text = clsRC.GetRCName(hdnChargeTo.Value); ddlType.SelectedValue = mrcf.RequestType; txtDateReq.Text = mrcf.DateRequested.ToString("MMMM dd, yyyy"); hdnGrpHeadCode.Value = mrcf.GroupHead; txtGrpHeadRem.Text = mrcf.GroupHeadRemarks; hdnDiviHeadCode.Value = mrcf.DivisionHead; txtDiviHeadRem.Text = mrcf.DivisionHeadRemarks; hdnProcMngrCode.Value = mrcf.ProcurementManager; txtProcMngrRem.Text = mrcf.ProcurementManagerRemarks; hdnStatus.Value = mrcf.Status; txtStat.Text = mrcf.StatusDescription; blnReadOnly = (mrcf.Status == "M" ? false : true); using (clsUsers users = new clsUsers()) { users.Username = hdnGrpHeadCode.Value; users.Fill(); txtGrpHeadName.Text = users.FullName; hdnGrpHeadMail.Value = users.Email; users.Username = hdnDiviHeadCode.Value; users.Fill(); txtDiviHeadName.Text = users.FullName; hdnDiviHeadMail.Value = users.Email; users.Username = hdnProcMngrCode.Value; users.Fill(); txtProcMngrName.Text = users.FullName; hdnProcMngrMail.Value = users.Email; } } }
protected void Page_Load(object sender, EventArgs e) { clsSpeedo.Authenticate(); btnPrint.Visible = false; //btnApprove.Attributes.Add("onclick", "this.disabled=true;" + GetPostBackEventReference(btnApprove).ToString()); //btnSave.Attributes.Add("onclick", "this.disabled=true;" + GetPostBackEventReference(btnSave).ToString()); //btnModify.Attributes.Add("onclick", "this.disabled=true;" + GetPostBackEventReference(btnModify).ToString()); string strProcessScript = "this.value='Processing...';this.disabled=true;"; btnApprove.Attributes.Add("onclick", strProcessScript + ClientScript.GetPostBackEventReference(btnApprove, "").ToString()); btnDisApprove.Attributes.Add("onclick", strProcessScript + ClientScript.GetPostBackEventReference(btnDisApprove, "").ToString()); btnModify.Attributes.Add("onclick", strProcessScript + ClientScript.GetPostBackEventReference(btnModify, "").ToString()); btnApprove2.Attributes.Add("onclick", strProcessScript + ClientScript.GetPostBackEventReference(btnApprove2, "").ToString()); btnDisapprove2.Attributes.Add("onclick", strProcessScript + ClientScript.GetPostBackEventReference(btnDisapprove2, "").ToString()); btnModification2.Attributes.Add("onclick", strProcessScript + ClientScript.GetPostBackEventReference(btnModification2, "").ToString()); if (!Page.IsPostBack) { BindEmployee(); clsMRCF.AuthenticateUser(clsMRCF.MRCFUserType.ProcurementManager, Request.Cookies["Speedo"]["UserName"].ToString(), Request.QueryString["mrcfcode"].ToString()); bool blnReadOnly; txtMrcfCode.Text = Request.QueryString["mrcfcode"].ToString(); txtProcMngrName.Text = clsUsers.GetName(Request.Cookies["Speedo"]["UserName"]); clsMRCF mrcf = new clsMRCF(txtMrcfCode.Text); mrcf.Fill(); hdnRequestor.Value = mrcf.Username; txtReqType.Text = mrcf.RequestTypeDesc; txtDateReq.Text = mrcf.DateRequested.ToString("MMMM dd, yyyy"); txtIntended.Text = mrcf.Intended; hdnChargeTo.Value = mrcf.ChargeTo; hdnGrpHeadCode.Value = mrcf.GroupHead; txtGrpHeadRem.Text = mrcf.GroupHeadRemarks; hdnGrpHeadStat.Value = mrcf.GroupHeadStatus; hdnDiviHeadCode.Value = mrcf.DivisionHead; txtDiviHeadRem.Text = mrcf.DivisionHeadRemarks; hdnDiviHeadStat.Value = mrcf.DivisionHeadStatus; hdnProcMngrCode.Value = mrcf.ProcurementManager; txtProcMngrRem.Text = mrcf.ProcurementManagerRemarks; hdnProcMngrStat.Value = mrcf.ProcurementManagerStatus; txtStat.Text = mrcf.StatusDescription; blnReadOnly = (hdnProcMngrStat.Value == "F" ? false : true); txtRCName.Text = clsEmployee.GetRCName(hdnRequestor.Value); txtChargeTo.Text = clsRC.GetRCName(hdnChargeTo.Value); using (clsUsers users = new clsUsers()) { users.Username = hdnRequestor.Value; users.Fill(); txtRequestorName.Text = users.FullName; hdnRequestorMail.Value = users.Email; users.Username = hdnGrpHeadCode.Value; users.Fill(); txtGrpHeadName.Text = users.FullName; hdnGrpHeadMail.Value = users.Email; users.Username = hdnDiviHeadCode.Value; users.Fill(); txtDiviHeadName.Text = users.FullName; hdnDiviHeadMail.Value = users.Email; } BindItems(); divButtons.Visible = !blnReadOnly; divButtons2.Visible = !blnReadOnly; divSave.Visible = blnReadOnly; txtProcMngrRem.ReadOnly = blnReadOnly; if (blnReadOnly) { txtProcMngrRem.BackColor = System.Drawing.Color.FromName("#f0f8ff"); } } }