protected void grdClarifications_RowCommand(object sender, GridViewCommandEventArgs e) { /* if (e.CommandName == "RespondToClarify") * { * ViewState["ID"] = e.CommandArgument; * string ClarifyID = ViewState["ID"].ToString * } */ ViewState["ID"] = e.CommandArgument; int ClarifyID = Convert.ToInt32(ViewState["ID"]); ClarifyBLL ClarifyBLL = new ClarifyBLL(); ClarifyBO ClarifyBO = new ClarifyBO(); ClarifyBO = ClarifyBLL.SelectClarification(ClarifyID); if (ClarifyBO.Status == "Pending") { PapDetails.Visible = true; RequesterDetails.Visible = true; txtClarifyDetails.Enabled = false; txtResponseDetails.Enabled = true; ClarificationDetail.Visible = true; txtHHID.Text = ClarifyBO.HHID.ToString(); txtPapName.Text = ClarifyBO.PapName; txtRequester.Text = ClarifyBO.Requester; txtClarifyDetails.Text = ClarifyBO.RequestDetails; } else { ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "Alert", "<script>alert('You have already responded to this query');</script>", false); } }
private void MyClarifications(bool addRow, bool deleteRow) { //int HHID = Convert.ToInt32(Request.QueryString["HHID"]); int UserID = Convert.ToInt32(Request.QueryString["UserID"]); ClarifyBLL ClarifyBLL = new ClarifyBLL(); grdClarifications.DataSource = ClarifyBLL.GetMyClarifications(UserID); grdClarifications.DataBind(); }
protected void SaveButton_Click(object sender, EventArgs e) { if (Request.QueryString["Mode"] == "Clarify") { if (txtClarifyDetails.Text == "" || ddlProjectPersonnel.SelectedIndex == 0) { ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "Alert", "<script>alert('Empty Clarification, Check Details or Select Respondent');</script>", false); } else { string statusMessage = string.Empty; string UserID = Request.QueryString["UserID"]; string ReqID = Request.QueryString["ReqID"]; int HHID = Convert.ToInt32(Request.QueryString["HHID"]); ClarifyBO ClarifyBO = new ClarifyBO(); ClarifyBO.TrackHeader = Convert.ToInt32(ReqID); ClarifyBO.RequestDetails = txtClarifyDetails.Text.ToString(); ClarifyBO.UserID = Convert.ToInt32(UserID); ClarifyBO.HHID = HHID; ClarifyBO.RespondentID = Convert.ToInt32(ddlProjectPersonnel.SelectedValue); ClarifyBLL ClarifyBLL = new ClarifyBLL(); statusMessage = ClarifyBLL.InsertClarify(ClarifyBO); if (statusMessage == "Failed") { ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "Alert", "<script>alert('Pending Clarifications Already Exist');</script>", false); /* Alert that displays custom variable * ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "Alert", "<script>alert(\"You have selected " + ClarifyID + "\");</script>", false); */ } else { ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "Alert", "<script>alert('Your Clarification has been Sent');</script>", false); ddlProjectPersonnel.ClearSelection(); txtClarifyDetails.Text = string.Empty; BindClarifications(false, false); } } } else { if (txtResponseDetails.Text == "") { ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "Alert", "<script>alert('Empty Response');</script>", false); } else { string statusMessage = string.Empty; int ReqID = Convert.ToInt32(ViewState["ID"]); // int HHID = Convert.ToInt32(Request.QueryString["HHID"]); ClarifyBO ClarifyBO = new ClarifyBO(); ClarifyBO.ID = ReqID; ClarifyBO.ResponseDetails = txtResponseDetails.Text.ToString(); ClarifyBO.Status = "Resolved"; ClarifyBLL ClarifyBLL = new ClarifyBLL(); statusMessage = ClarifyBLL.InsertReponse(ClarifyBO); if (statusMessage == "Failed") { ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "Alert", "<script>alert('Response Not Sent');</script>", false); /* Alert that displays custom variable * ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "Alert", "<script>alert(\"You have selected " + ClarifyID + "\");</script>", false); */ } else { ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "Alert", "<script>alert('Your Response has been Sent');</script>", false); // ddlProjectPersonnel.ClearSelection(); txtResponseDetails.Text = string.Empty; txtResponseDetails.Enabled = false; PapDetails.Visible = false; RequesterDetails.Visible = false; ClarificationDetail.Visible = false; MyClarifications(false, false); } } } }