protected void LoadMRCFForImport() { string strWrite = ""; DataTable tblMRCFForImport = clsOracleMrcf.GetMRCFForImport(); foreach (DataRow drNew in tblMRCFForImport.Rows) { if (!clsOracleMrcf.IsBatchVoid(drNew["BATCH_ID"].ToString())) { if (clsOracleMrcf.GetMRCF(drNew["BATCH_ID"].ToString()) != string.Empty) { clsMRCF mrcf = new clsMRCF(clsOracleMrcf.GetMRCF(drNew["BATCH_ID"].ToString())); mrcf.Fill(); strWrite = strWrite + "<tr>" + "<td class='GridRows'>" + drNew["BATCH_ID"].ToString() + "</td>" + "<td class='GridRows'><a href='MRCFDetailsPM.aspx?mrcfcode=" + clsOracleMrcf.GetMRCF(drNew["BATCH_ID"].ToString()) + "' style='font-size:small;'>" + clsOracleMrcf.GetMRCF(drNew["BATCH_ID"].ToString()) + "</a></td>" + "<td class='GridRows'>" + mrcf.Intended + "</td>" + "<td class='GridRows'>" + mrcf.Username + "</td>" + "<td class='GridRows'>" + mrcf.DateRequested.ToString("MMMM dd, yyyy") + "</td>" + "</tr>"; } } } Response.Write(strWrite); }
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(); 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) { 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"); } } }