/// <summary> /// To fetch projectsegment by ID and assign to textbox /// </summary> private void GetProjectSegmentByID() { ProjectBLL oProjectBLL = new ProjectBLL(); SegmentBO oProjectSegment = oProjectBLL.GetProjectSegmentByID(ViewStateProjectSegmentId); if (oProjectSegment != null) { txtSegmentName.Text = oProjectSegment.SegmentName; txtRouteLength.Text = oProjectSegment.RouteLength; ddlTypeLine.SelectedValue = oProjectSegment.LineTypeID.ToString(); lblRightofWayMeasurement.Text = oProjectSegment.RightOfWay; lblWayLeaveMeasurement.Text = oProjectSegment.WayLeave; txtEstBudget.Text = UtilBO.CurrencyFormat(oProjectSegment.EstBudget); txtImplementationPeriod.Text = oProjectSegment.ImplementationPeriod.ToString(); dpConstructionStartDate.Text = Convert.ToString(oProjectSegment.ConstrStartDate.ToString(UtilBO.DateFormat)); dpConstructionEndDate.Text = Convert.ToString(oProjectSegment.ConstrEndDate.ToString(UtilBO.DateFormat)); txtfunder.Text = oProjectSegment.Funder; ddlBank.ClearSelection(); if (ddlBank.Items.FindByValue(oProjectSegment.Bankid.ToString()) != null) { ddlBank.Items.FindByValue(oProjectSegment.Bankid.ToString()).Selected = true; } txtValueofhouse.Text = UtilBO.CurrencyFormat(oProjectSegment.Valueofhouse); } DisplayEstBudget(); }
public static TypeOfLineBO GetTypeOfLineDetails(int segmentID) { ProjectBLL objProjectBLL = new ProjectBLL(); SegmentBO objSegment = objProjectBLL.GetProjectSegmentByID(segmentID); TypeOfLineBO objTypeOfLine = null; if (objSegment != null) { TypeOfLineBLL objTypeOfLineBLL = new TypeOfLineBLL(); objTypeOfLine = objTypeOfLineBLL.GetLineTypebyID(objSegment.LineTypeID); } return(objTypeOfLine); }
/// <summary> /// To bind SegmentDetails to grid /// </summary> /// <param name="ProjectId"></param> private void LoadProjectSegmentGV(int ProjectId) { ProjectBLL objProjectSegmentBLL = new ProjectBLL(); SegmentBO objProjectSegment = new SegmentBO(); grdSegmentDetails.DataSource = objProjectSegmentBLL.GetProjectSegment(ProjectId); grdSegmentDetails.DataBind(); if (grdSegmentDetails.Rows.Count > 0) { p1Grid.Style.Add("display", ""); } else { p1Grid.Style.Add("display", "none"); } // ddlCurrencyTypeEstBudget.Items.FindByText(ViewState["BudgetCurrency"].ToString(); // LoadTypeLine(); }
/// <summary> /// used to add details and save to database /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnADDSegment_Click(object sender, EventArgs e) { //Adding New Segment string message = string.Empty; SegmentBO objProjectSegment = new SegmentBO(); ProjectBLL oProjectBLL = new ProjectBLL(); objProjectSegment.SegmentName = txtSegmentName.Text; objProjectSegment.RouteLength = Convert.ToDecimal(txtRouteLength.Text).ToString(); objProjectSegment.LineTypeID = Convert.ToInt32(ddlTypeLine.SelectedValue); if (Session["PROJECT_ID"] != null) { objProjectSegment.ProjectID = Convert.ToInt32(Session["PROJECT_ID"].ToString()); } objProjectSegment.EstBudget = Convert.ToDecimal(txtEstBudget.Text); objProjectSegment.ImplementationPeriod = txtImplementationPeriod.Text; objProjectSegment.ConstrStartDate = Convert.ToDateTime(dpConstructionStartDate.Text); objProjectSegment.ConstrEndDate = Convert.ToDateTime(dpConstructionEndDate.Text); objProjectSegment.Funder = txtfunder.Text; objProjectSegment.Bankid = Convert.ToInt32(ddlBank.SelectedItem.Value); objProjectSegment.Valueofhouse = Convert.ToDecimal(txtValueofhouse.Text); objProjectSegment.CreatedBy = Convert.ToInt32(Session["USER_ID"].ToString()); objProjectSegment.IsDeleted = "False"; if (ViewStateProjectSegmentId > 0) { //Updating the Segment objProjectSegment.ProjectSegmentID = ViewStateProjectSegmentId; message = oProjectBLL.UpdateProjectSegment(objProjectSegment); SetUpdateMode(true); if (string.IsNullOrEmpty(message) || message == "" || message == "null") { message = "Data updated successfully"; } } else { //Adding New Segment message = oProjectBLL.SaveProjectSegment(objProjectSegment); if (string.IsNullOrEmpty(message) || message == "" || message == "null") { message = "Data saved successfully"; } } ClearSegment(); //Loading Segments if (Session["PROJECT_ID"] != null) { int ProjectId = Convert.ToInt32(Session["PROJECT_ID"]); LoadProjectSegmentGV(ProjectId); } if (message != "") { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('" + message + "');", true); } }
/// <summary> /// To Update Project Segment /// </summary> /// <param name="oProjectSegment"></param> /// <returns></returns> public string UpdateProjectSegment(SegmentBO oProjectSegment) { return((new ProjectDAL()).UpdateProjectSegment(oProjectSegment)); }
/// <summary> /// To Save Project Segment /// </summary> /// <param name="oProjectSegment"></param> /// <returns></returns> public string SaveProjectSegment(SegmentBO oProjectSegment) { return((new ProjectDAL()).SaveProjectSegment(oProjectSegment)); }