Esempio n. 1
0
        /// <summary>
        /// to save the data to the database
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            getApprrequtStatusGroupOwnerShip();//add by ramu.s @ 11 /07/2013

            PAP_GroupOwnershipBO objGroupOwnership = new PAP_GroupOwnershipBO();

            objGroupOwnership.HHID              = Convert.ToInt32(Session["HH_ID"]);
            objGroupOwnership.Paptype           = ddlPaptype.SelectedValue;
            objGroupOwnership.Papuid            = txtPapUid.Text.Trim();
            objGroupOwnership.DistrictIN        = ddlDistrict.SelectedItem.Text;
            objGroupOwnership.CountyIN          = ddlCounty.SelectedItem.Text;
            objGroupOwnership.SubCountyIN       = ddlSubCounty.SelectedItem.Text;
            objGroupOwnership.ParishIN          = ddlParish.SelectedItem.Text;
            objGroupOwnership.VillageIN         = ddlVillage.SelectedItem.Text;
            objGroupOwnership.OptionGroupIdIN   = Convert.ToInt32(ddloptionGroup.SelectedItem.Value);
            objGroupOwnership.PlotReferenceIN   = txtPlotReference.Text;
            objGroupOwnership.DateofBirthIN     = Convert.ToDateTime(dpDateofBirth.Text.ToString());
            objGroupOwnership.IsResidentIN      = rdlResident.SelectedItem.Text;
            objGroupOwnership.SexIN             = ddlGender.SelectedItem.Text;
            objGroupOwnership.SurnameIN         = txtSurname.Text;
            objGroupOwnership.FirstnameIN       = txtfirstname.Text;
            objGroupOwnership.OthernameIN       = txtOthername.Text;
            objGroupOwnership.PositionidIN      = Convert.ToInt32(ddlPosition.SelectedValue);
            objGroupOwnership.Contactphone1IN   = txtTelephoneNo1.Text;
            objGroupOwnership.Contactphone2IN   = txtTelephoneNo2.Text;
            objGroupOwnership.Gouallowance      = ddlGouAllowance.SelectedValue;
            objGroupOwnership.Undertakingperiod = ddlUnderTakingPeriod.SelectedValue;
            objGroupOwnership.Createdby         = Convert.ToInt32(Session["USER_ID"]);
            if (dpCapturedDate.Text.ToString().Trim() != "" && dpCapturedDate.Text.ToString().Trim() != "1/1/0001")
            {
                objGroupOwnership.CapturedDate = dpCapturedDate.Text.ToString();
            }
            objGroupOwnership.CapturedBy = txtCapturedBy.Text;

            PAP_GroupOwnershipBLL objGroupOwnershipBll = new PAP_GroupOwnershipBLL();
            string message = objGroupOwnershipBll.UpdateGroupOwnershipDetails(objGroupOwnership);

            txtFullname.Text = txtSurname.Text + " " + txtfirstname.Text + " " + txtOthername.Text;
            projectFrozen();//add by ramu.s @ 11 /07/2013
            ChangeRequestStatusGroupOwnerShip();
            if (string.IsNullOrEmpty(message) || message == "" || message == "null")
            {
                message = "Data saved successfully";
            }
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('" + message + "');", true);

            // Re Cache Pap Details
            ReCache(Convert.ToInt32(Session["HH_ID"]));
        }