/// <summary>
 /// To Insert and Update Group Ownership
 /// </summary>
 /// <param name="objGroupOwnership"></param>
 public void InsertandUpdateGroupOwnership(PAP_GroupOwnershipBO objGroupOwnership)
 {
     try
     {
         cnn             = new OracleConnection(con);
         cmd             = new OracleCommand("USP_TRN_UPD_GROUPMEMBERS", cnn);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.Add("GroupmemberidIN", objGroupOwnership.Groupmemberid);
         cmd.Parameters.Add("HhidIN", objGroupOwnership.HHID);
         cmd.Parameters.Add("SurnameIN", objGroupOwnership.SurnameIN);
         cmd.Parameters.Add("FirstnameIN", objGroupOwnership.FirstnameIN);
         cmd.Parameters.Add("OthernameIN", objGroupOwnership.OthernameIN);
         cmd.Parameters.Add("CreatedbyIN", objGroupOwnership.Createdby);
         cnn.Open();
         cmd.ExecuteNonQuery();
         cnn.Close();
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         cmd.Dispose();
         cnn.Close();
         cnn.Dispose();
     }
 }
Exemple #2
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"]));
        }
        /// <summary>
        /// To Get Group Ownership By HHID
        /// </summary>
        /// <param name="HHID"></param>
        /// <returns></returns>
        public PAP_GroupOwnershipList GetGroupOwnershipByHHID(int HHID)
        {
            PAP_GroupOwnershipBO   objGroupOwnership = null;
            PAP_GroupOwnershipList PAP_GroupOwnershiplist1;

            try
            {
                cnn             = new OracleConnection(con);
                cmd             = new OracleCommand("USP_TRN_GET_PAP_GROUPMEMBERS", cnn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("HHIDIN", HHID);
                cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
                cnn.Open();
                OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
                PAP_GroupOwnershiplist1 = new PAP_GroupOwnershipList();
                while (dr.Read())
                {
                    objGroupOwnership = new PAP_GroupOwnershipBO();
                    if (!dr.IsDBNull(dr.GetOrdinal("HHID")))
                    {
                        objGroupOwnership.HHID = dr.GetInt32(dr.GetOrdinal("HHID"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("GROUPMEMBERID")))
                    {
                        objGroupOwnership.Groupmemberid = dr.GetInt32(dr.GetOrdinal("GROUPMEMBERID"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("SURNAME")))
                    {
                        objGroupOwnership.SurnameIN = dr.GetString(dr.GetOrdinal("SURNAME"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("FIRSTNAME")))
                    {
                        objGroupOwnership.FirstnameIN = dr.GetString(dr.GetOrdinal("FIRSTNAME"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("OTHERNAME")))
                    {
                        objGroupOwnership.OthernameIN = dr.GetString(dr.GetOrdinal("OTHERNAME"));
                    }
                    PAP_GroupOwnershiplist1.Add(objGroupOwnership);
                }
                dr.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(PAP_GroupOwnershiplist1);
        }
Exemple #4
0
        /// <summary>
        /// to save the member data to the database
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSavemember_Click(object sender, EventArgs e)
        {
            PAP_GroupOwnershipBO objGroupOwnership = new PAP_GroupOwnershipBO();

            if (ViewState["Groupmemberid"] != null)
            {
                objGroupOwnership.Groupmemberid = Convert.ToInt32(ViewState["Groupmemberid"]);
            }
            else
            {
                objGroupOwnership.Groupmemberid = 0;
            }
            objGroupOwnership.HHID        = Convert.ToInt32(Session["HH_ID"]);
            objGroupOwnership.SurnameIN   = txtMeberSurname.Text;
            objGroupOwnership.FirstnameIN = txtMeberFirstname.Text;
            objGroupOwnership.OthernameIN = txtMeberOthername.Text;
            objGroupOwnership.Createdby   = Convert.ToInt32(Session["USER_ID"]);

            PAP_GroupOwnershipBLL objGroupOwnershipBll = new PAP_GroupOwnershipBLL();

            objGroupOwnershipBll.InsertandUpdateGroupOwnership(objGroupOwnership);
            // Reload Pap Details
            ReCache(Convert.ToInt32(Session["HH_ID"]));

            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('Data saved successfully');", true);
            txtMeberSurname.Text       = "";
            txtMeberFirstname.Text     = "";
            txtMeberOthername.Text     = "";
            txtMeberFullname.Text      = "";
            ViewState["Groupmemberid"] = 0;
            btnSavemember.Text         = "Save";
            btnClearMember.Text        = "Clear";
            projectFrozen();                     //add by ramu.s @ 11 /07/2013
            getApprrequtStatusGroupMemberShip(); //add by ramu.s @ 11 /07/2013
            BindGrid();
        }
Exemple #5
0
 /// <summary>
 /// To Insert and Update Group Ownership
 /// </summary>
 /// <param name="objGroupOwnership"></param>
 public void InsertandUpdateGroupOwnership(PAP_GroupOwnershipBO objGroupOwnership)
 {
     (new PAP_GroupOwnershipDAL()).InsertandUpdateGroupOwnership(objGroupOwnership);
 }
Exemple #6
0
 /// <summary>
 /// To Update Group Ownership Details
 /// </summary>
 /// <param name="objGroupOwnership"></param>
 /// <returns></returns>
 public string UpdateGroupOwnershipDetails(PAP_GroupOwnershipBO objGroupOwnership)
 {
     return((new PAP_GroupOwnershipDAL()).UpdateGroupOwnershipDetails(objGroupOwnership));
 }
        /// <summary>
        /// To Update Group Ownership Details
        /// </summary>
        /// <param name="objGroupOwnership"></param>
        /// <returns></returns>
        public string UpdateGroupOwnershipDetails(PAP_GroupOwnershipBO objGroupOwnership)
        {
            string result = "";

            try
            {
                cnn             = new OracleConnection(con);
                cmd             = new OracleCommand("USP_TRN_UPD_HH_GROUPOWNER", cnn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("Hh_IDIN", objGroupOwnership.HHID);
                cmd.Parameters.Add("PaptypeIN", objGroupOwnership.Paptype);
                cmd.Parameters.Add("DistrictIN", objGroupOwnership.DistrictIN);
                cmd.Parameters.Add("CountyIN", objGroupOwnership.CountyIN);
                cmd.Parameters.Add("SubCountyIN", objGroupOwnership.SubCountyIN);
                cmd.Parameters.Add("ParishIN", objGroupOwnership.ParishIN);
                cmd.Parameters.Add("VillageIN", objGroupOwnership.VillageIN);
                cmd.Parameters.Add("OptionGroupIdIN", objGroupOwnership.OptionGroupIdIN);
                cmd.Parameters.Add("PlotReferenceIN", objGroupOwnership.PlotReferenceIN);
                cmd.Parameters.Add("DateofBirthIN", objGroupOwnership.DateofBirthIN);
                cmd.Parameters.Add("IsResidentIN", objGroupOwnership.IsResidentIN);
                cmd.Parameters.Add("SexIN", objGroupOwnership.SexIN);
                cmd.Parameters.Add("SurnameIN", objGroupOwnership.SurnameIN);
                cmd.Parameters.Add("FirstnameIN", objGroupOwnership.FirstnameIN);
                cmd.Parameters.Add("OthernameIN", objGroupOwnership.OthernameIN);
                cmd.Parameters.Add("PositionidIN", objGroupOwnership.PositionidIN);
                cmd.Parameters.Add("Contactphone1IN", objGroupOwnership.Contactphone1IN);
                cmd.Parameters.Add("Contactphone2IN", objGroupOwnership.Contactphone2IN);
                cmd.Parameters.Add("UpdatedbyIN", objGroupOwnership.Createdby);
                cmd.Parameters.Add("PAP_UIDIN", objGroupOwnership.Papuid);
                cmd.Parameters.Add("@DETAILSCAPTUREDBYIN", objGroupOwnership.CapturedBy);
                if (objGroupOwnership.CapturedDate.Trim() != "")
                {
                    cmd.Parameters.Add("@DETAILSCAPTUREDDATEIN", Convert.ToDateTime(objGroupOwnership.CapturedDate).ToString(UtilBO.DateFormatDB));
                }
                else
                {
                    cmd.Parameters.Add("@DETAILSCAPTUREDDATEIN", DBNull.Value);
                }

                cmd.Parameters.Add("@GOUSTATUS_", objGroupOwnership.Gouallowance);
                cmd.Parameters.Add("@UNDERTAKINGPERIOD_", objGroupOwnership.Undertakingperiod);
                cmd.Parameters.Add("errorMessage_", OracleDbType.Varchar2, 500).Direction = ParameterDirection.Output;
                cnn.Open();
                cmd.ExecuteNonQuery();

                if (cmd.Parameters["errorMessage_"].Value != null)
                {
                    result = cmd.Parameters["errorMessage_"].Value.ToString();
                }
                else
                {
                    result = string.Empty;
                }

                cnn.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                cmd.Dispose();
                cnn.Close();
                cnn.Dispose();
            }
            return(result);
        }