protected void GrdTarget_RowCommand(object sender, GridViewCommandEventArgs e) { int i = 0; objComOutputTarget = new OutputTarget(); if (e.CommandName == "edit") { GridViewRow gvr = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer); int RowIndex = gvr.RowIndex; objComOutputTarget.ActivityOutputMapId = int.Parse(e.CommandArgument.ToString()); objComOutputTarget.PustyayiyekoShrot = ((TextBox)grdTarget.Rows[RowIndex].FindControl("txtPustyayiyekoShrot")).Text; objComOutputTarget.TargetFirstYear = ((TextBox)grdTarget.Rows[RowIndex].FindControl("txtFirstYearTarget")).Text; objComOutputTarget.TargetSecondYear = ((TextBox)grdTarget.Rows[RowIndex].FindControl("txtSecondYearTarget")).Text; objComOutputTarget.TargetThirdYear = ((TextBox)grdTarget.Rows[RowIndex].FindControl("txtThirdYearTarget")).Text; objWebService = new OutputTargetService(); objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationOutputTarget(); i = objWebService.AddTarget(objComOutputTarget); if (i > 0) { Response.Write("<script>alert('Target successfully recorded.') </script>"); Response.Redirect(Constants.ConstantAppPath + "/Modules/OutputTargetManagement/ListTarget.aspx"); } else { Response.Write("<script>alert('Target not recorded.') </script>"); } } }
private void PopulateActivities(int ssid) { DataTable dt = new DataTable(); objWebService = new OutputTargetService(); objComOutputTarget = new OutputTarget(); objComOutputTarget.Lang = Session["LanguageSetting"].ToString(); objComOutputTarget.SubSectorId = ssid; objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationOutputTarget(); dt = objWebService.PopulateAllActivitiesToFilter(objComOutputTarget); if (dt != null && dt.Rows.Count > 0) { ddlActivity.DataSource = dt; ddlActivity.DataTextField = "ACTIVITY_NAME"; ddlActivity.DataValueField = "ACTIVITY_DETAIL_ID"; ddlActivity.DataBind(); ddlActivity.Items.Insert(0, "--सूचक छान्नुहोस्--"); ddlModalActivity.DataSource = dt; ddlModalActivity.DataTextField = "ACTIVITY_NAME"; ddlModalActivity.DataValueField = "ACTIVITY_DETAIL_ID"; ddlModalActivity.DataBind(); ddlModalActivity.Items.Insert(0, "--सूचक छान्नुहोस्--"); } }
private void PopulateSubSectors(int sid) { DataTable dt = new DataTable(); objWebService = new OutputTargetService(); objComOutputTarget = new OutputTarget(); objComOutputTarget.Lang = Session["LanguageSetting"].ToString(); objComOutputTarget.SectorId = sid; objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationOutputTarget(); dt = objWebService.PopulateSubSectorsToFilter(objComOutputTarget); if (dt != null && dt.Rows.Count > 0) { ddlSubSector.DataSource = dt; ddlSubSector.DataTextField = "Sub_Sector_Name"; ddlSubSector.DataValueField = "Activity_Sub_Sector_ID"; ddlSubSector.DataBind(); ddlSubSector.Items.Insert(0, "--उपक्षेत्र छान्नुहोस्--"); ddlModalSubSector.DataSource = dt; ddlModalSubSector.DataTextField = "Sub_Sector_Name"; ddlModalSubSector.DataValueField = "Activity_Sub_Sector_ID"; ddlModalSubSector.DataBind(); ddlModalSubSector.Items.Insert(0, "--उपक्षेत्र छान्नुहोस्--"); } }
protected void BtnEdit_Command(object sender, CommandEventArgs e) { int outputId = 0; if (e.CommandName == "edit") { outputId = int.Parse(e.CommandArgument.ToString()); SecureQueryString str = new SecureQueryString(); str["id"] = e.CommandArgument.ToString(); Response.Redirect(Constants.ConstantAppPath + "/Modules/OutputTargetManagement/AddOutput.aspx" + str.EncryptedString, false); } else if (e.CommandName == "delete") { objComOutputTarget = new OutputTarget(); objComOutputTarget.ActivityOutputId = int.Parse(e.CommandArgument.ToString()); objComOutputTarget.Mode = "D"; objWebService = new OutputTargetService(); objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationOutputTarget(); objWebService.AddOutput(objComOutputTarget); Response.Redirect(Constants.ConstantAppPath + "/Modules/OutputTargetManagement/ListOutput.aspx"); } else if (e.CommandName == "lock") { int i = 0; objComOutputTarget = new OutputTarget(); objComOutputTarget.ActivityOutputId = int.Parse(e.CommandArgument.ToString()); objComOutputTarget.Mode = "L"; objWebService = new OutputTargetService(); objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationOutputTarget(); i = objWebService.AddOutput(objComOutputTarget); if (i > 0) { Response.Redirect(Constants.ConstantAppPath + "/Modules/OutputTargetManagement/ListOutput.aspx"); } else { Response.Write("<script>alert('Lock failed')</script>"); } } else { int i = 0; objComOutputTarget = new OutputTarget(); objComOutputTarget.ActivityOutputId = int.Parse(e.CommandArgument.ToString()); objComOutputTarget.Mode = "L"; objWebService = new OutputTargetService(); objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationOutputTarget(); i = objWebService.AddOutput(objComOutputTarget); if (i > 0) { Response.Redirect(Constants.ConstantAppPath + "/Modules/OutputTargetManagement/ListOutput.aspx"); } else { Response.Write("<script>alert('Unlock failed')</script>"); } } }
/* protected void ddlSubSector_SelectedIndexChanged(object sender, EventArgs e) * { * populateActivities(ddlSubsector.SelectedValue.ToInt32()); * } * * * * private void populateActivities(int i) * { * DataTable dt = new DataTable(); * objOutputTarget = new OutputTarget(); * objOutputTarget.Lang = Session["LanguageSetting"].ToString(); * objOutputTarget.SubSectorId = i; * objWebService = new OutputTargetService(); * objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationOutputTarget(); * dt = objWebService.populateActivities(objOutputTarget); * if (dt != null && dt.Rows.Count > 0) * { * ddlOutputType.DataSource = dt; * ddlOutputType.DataTextField = "ACTIVITY_NAME"; * ddlOutputType.DataValueField = "ACTIVITY_ID"; * ddlOutputType.DataBind(); * ddlOutputType.Items.Insert(0, "--Select Activity--"); * } * }*/ protected void btnAddOutput_Click(object sender, EventArgs e) { int i = 0; objOutputTarget = new OutputTarget(); objOutputTarget.ActivityOutputId = Session["outputId"].ToInt32(); objOutputTarget.ActivityOutputEngName = txtOutputEngName.Text; objOutputTarget.ActivityOutputNepName = txtOutputNepName.Text; objOutputTarget.ActivityOutputCode = txtOutputCode.Text; objOutputTarget.ParentOutputId = ddlOutput.SelectedValue.ToInt32(); objOutputTarget.ActivityOutputTypeId = ddlOutputType.SelectedValue.ToInt32(); objOutputTarget.ToipYear = txtToipYear.Text; objOutputTarget.SubSectorId = ddlSubsector.SelectedValue.ToInt32(); // objOutputTarget.ActivityId = ddlActivity.SelectedValue.ToInt32(); string responsibleOffices = string.Empty; foreach (ListItem it in chkResponsibleOffices.Items) { if (it.Selected) { responsibleOffices += it.Value + ","; } } objOutputTarget.ResponsibleOfficeId = responsibleOffices; objOutputTarget.IsEnable = (chkIsEnable.Checked) ? 1 : 0; objOutputTarget.IsLocked = 0; if (Session["outputId"].ToInt32() == 0) { objOutputTarget.Mode = "I"; } else { objOutputTarget.Mode = "U"; } objWebService = new OutputTargetService(); objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationOutputTarget(); i = objWebService.AddOutput(objOutputTarget); if (i > 0) { Response.Write("<script>alert('Activity output added successfully!')</script>"); Response.Redirect(Constants.ConstantAppPath + "/Modules/OutputTargetManagement/ListOutput.aspx"); } else { Response.Write("<script>alert('Activity output addition failed!')</script>"); } }
private void populateOutputDetails(int i) { objWebService = new OutputTargetService(); objOutputTarget = new OutputTarget(); objOutputTarget.Lang = Session["LanguageSetting"].ToString(); objOutputTarget.ActivityOutputId = i; objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationOutputTarget(); Session["dtPopulateOutput"] = objWebService.PopulateOutputById(objOutputTarget); DataTable dtPopulateOutput = (DataTable)Session["dtPopulateOutput"]; if (dtPopulateOutput != null && dtPopulateOutput.Rows.Count > 0) { txtOutputEngName.Text = dtPopulateOutput.Rows[0]["ACTIVITY_OUTPUT_ENG_NAME"].ToString(); txtOutputNepName.Text = dtPopulateOutput.Rows[0]["ACTIVITY_OUTPUT_NEP_NAME"].ToString(); txtOutputCode.Text = dtPopulateOutput.Rows[0]["ACTIVITY_OUTPUT_CODE"].ToString(); ddlOutput.SelectedValue = dtPopulateOutput.Rows[0]["PARENT_OUTPUT_ID"].ToString(); ddlOutputType.SelectedValue = dtPopulateOutput.Rows[0]["ACTIVITY_OUTPUT_TYPE_ID"].ToString(); txtToipYear.Text = dtPopulateOutput.Rows[0]["TOIP_YEAR"].ToString(); ddlSubsector.SelectedValue = dtPopulateOutput.Rows[0]["SUB_SECTOR_ID"].ToString(); string responsibleOffices = dtPopulateOutput.Rows[0]["RESPONSIBLE_OFFICE_ID"].ToString(); if (responsibleOffices != "" || responsibleOffices != string.Empty) { List <string> offices = responsibleOffices.Split(new char[] { ',' }).ToList <string>(); for (int k = 0; k < chkResponsibleOffices.Items.Count; k++) { for (int j = 0; j < offices.Count; j++) { if (chkResponsibleOffices.Items[k].Value == offices[j]) { chkResponsibleOffices.Items[k].Selected = true; break; } } } } //ddlActivity.SelectedValue = dtPopulateOutput.Rows[0]["ACTIVITY_ID"].ToString(); if (dtPopulateOutput.Rows[0]["ISENABLE"].ToString() == "1") { chkIsEnable.Checked = true; } else { chkIsEnable.Checked = false; } } }
private void BindListView() { objWebService = new OutputTargetService(); objComOutputTarget = new OutputTarget(); objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationOutputTarget(); objComOutputTarget.Lang = Session["LanguageSetting"].ToString(); dtListView = objWebService.PopulateAllOutputs(objComOutputTarget); if (dtListView != null && dtListView.Rows.Count > 0) { lvOutput.DataSource = dtListView; lvOutput.DataBind(); } else { } }
private void populateOutput() { objWebService = new OutputTargetService(); objComOutputTarget = new OutputTarget(); objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationOutputTarget(); objComOutputTarget.Lang = Session["LanguageSetting"].ToString(); dtOutput = objWebService.PopulateAllOutputs(objComOutputTarget); if (dtOutput != null && dtOutput.Rows.Count > 0) { ddlOutput.DataSource = dtOutput; ddlOutput.DataValueField = "ACTIVITY_OUTPUT_ID"; ddlOutput.DataTextField = "ACTIVITY_OUTPUT_NAME"; ddlOutput.DataBind(); ddlOutput.Items.Insert(0, "--छान्नुहोस्--"); } }
private void PopulateAllTargets() { objWebService = new OutputTargetService(); objComOutputTarget = new OutputTarget(); objComOutputTarget.Lang = Session["LanguageSetting"].ToString(); objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationOutputTarget(); dtTarget = objWebService.PopulateAllTargets(objComOutputTarget); if (dtTarget != null && dtTarget.Rows.Count > 0) { grdTarget.DataSource = dtTarget; grdTarget.DataBind(); Session["TargetData"] = dtTarget; } else { } }
private void populateSubSector() { DataTable dt = new DataTable(); objOutputTarget = new OutputTarget(); objOutputTarget.Lang = Session["LanguageSetting"].ToString(); objWebService = new OutputTargetService(); objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationOutputTarget(); dt = objWebService.populateSubSector(objOutputTarget); if (dt != null && dt.Rows.Count > 0) { ddlSubsector.DataSource = dt; ddlSubsector.DataTextField = "ACTIVITY_SUB_SECTOR_NAME"; ddlSubsector.DataValueField = "ACTIVITY_SUB_SECTOR_ID"; ddlSubsector.DataBind(); ddlSubsector.Items.Insert(0, "--Select Sub Sector Type--"); } }
protected void grdTarget_RowDataBound(object sender, GridViewRowEventArgs e) { //SelectFramework if (e.Row.RowType == DataControlRowType.DataRow) { objWebService = new OutputTargetService(); objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationOutputTarget(); DropDownList ddl = (DropDownList)e.Row.FindControl("ddlFramework"); ddl.DataSource = objWebService.SelectFramework(); ddl.DataValueField = "FRAMEWORK_ID"; ddl.DataTextField = "FRAMEWORK_NEP_NAME"; ddl.DataBind(); ListItem lst = new ListItem("--छान्नुहोस", "0"); ddl.Items.Insert(0, lst); DataTable dtTarget = (DataTable)Session["dtTarget"]; ddl.SelectedValue = dtTarget.Rows[e.Row.RowIndex]["framework_id"].ToString(); } }
protected void ddlSubSector_SelectedIndexChanged(object sender, EventArgs e) { DataTable dt = new DataTable(); objWebService = new OutputTargetService(); objComOutputTarget = new OutputTarget(); objComOutputTarget.Lang = Session["LanguageSetting"].ToString(); objComOutputTarget.SubSectorId = ddlSubSector.SelectedValue.ToInt32(); objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationOutputTarget(); dt = objWebService.PopulateAllActivitiesToFilter(objComOutputTarget); if (dt != null && dt.Rows.Count > 0) { ddlActivity.DataSource = dt; ddlActivity.DataTextField = "ACTIVITY_NAME"; ddlActivity.DataValueField = "ACTIVITY_DETAIL_ID"; ddlActivity.DataBind(); ddlActivity.Items.Insert(0, "--सूचक छान्नुहोस्--"); } }
private void PopulateAllTargets() { objWebService = new OutputTargetService(); objComOutputTarget = new OutputTarget(); objComOutputTarget.Lang = SessionHelper.SessionLanguageSetting; objComOutputTarget.MinistryId = Session["ministry_id"].ToInt32(); objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationOutputTarget(); objComOutputTarget.ProjectId = Session["prjId"].ToString().ToInt32(); DataTable dtTarget = objWebService.PopulateProjectTargets(objComOutputTarget); Session["dtTarget"] = dtTarget; if (dtTarget != null && dtTarget.Rows.Count > 0) { /*grdTarget.DataSource = dtTarget; * grdTarget.DataBind();*/ Session["TargetData"] = dtTarget; } else { } }
protected void GrdTarget_RowCommand(object sender, GridViewCommandEventArgs e) { int i = 0; objComOutputTarget = new OutputTarget(); if (e.CommandName == "edit") { GridViewRow gvr = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer); int RowIndex = gvr.RowIndex; objComOutputTarget.PtargetId = e.CommandArgument.ToString().ToDecimal(); objComOutputTarget.ActivityOutputMapId = ((HiddenField)grdTarget.Rows[RowIndex].FindControl("hidAOutputMapId")).Value.ToDecimal(); objComOutputTarget.TargetFirstYear = ((TextBox)grdTarget.Rows[RowIndex].FindControl("txtFirstYearTarget")).Text; objComOutputTarget.TargetSecondYear = ((TextBox)grdTarget.Rows[RowIndex].FindControl("txtSecondYearTarget")).Text; objComOutputTarget.TargetThirdYear = ((TextBox)grdTarget.Rows[RowIndex].FindControl("txtThirdYearTarget")).Text; objComOutputTarget.OverallTarget = ((TextBox)grdTarget.Rows[RowIndex].FindControl("txtOverAllTarget")).Text; objComOutputTarget.BaseYearTarget = ((TextBox)grdTarget.Rows[RowIndex].FindControl("txtBaseYearTarget")).Text; objComOutputTarget.ProjectId = Session["prjId"].ToString().ToInt32(); objComOutputTarget.FrameworkId = ((DropDownList)grdTarget.Rows[RowIndex].FindControl("ddlFramework")).SelectedValue.ToDecimal(); objComOutputTarget.Mode = "I"; if (objComOutputTarget.PtargetId != 0) { objComOutputTarget.Mode = "U"; } objWebService = new OutputTargetService(); objWebService.AuthSoapHdValue = ServiceAuth.ServiceAuthenticationOutputTarget(); i = objWebService.AddProjectOutputTarget(objComOutputTarget); if (i > 0) { Response.Redirect(Constants.ConstantAppPath + "/Modules/ProjectManagement/ListProjectTarget.aspx"); } else { Response.Write("<script>alert('Target not recorded.') </script>"); } } }