Ejemplo n.º 1
0
        // get the Grid value into textBox
        private void GetSocialPAPConcernDetails()
        {
            SocioConcernBLL ConcernBLLobj = new SocioConcernBLL();
            int             PapConcernID  = 0;

            if (ViewState["PapConcernID"] != null)
            {
                PapConcernID = Convert.ToInt32(ViewState["PapConcernID"]);
            }
            int HHID = Convert.ToInt32(Session["HH_ID"].ToString());

            SocioConcernBO SocioConcernBOObj = new SocioConcernBO();

            SocioConcernBOObj = ConcernBLLobj.GetSocioConcernById(PapConcernID, HHID);

            PAPConcernsDropDownList.ClearSelection();
            if (PAPConcernsDropDownList.Items.FindByValue(SocioConcernBOObj.ConcernID.ToString()) != null)
            {
                PAPConcernsDropDownList.Items.FindByValue(SocioConcernBOObj.ConcernID.ToString()).Selected = true;
            }

            PAPOtherConcernsTextBox.Text = SocioConcernBOObj.OtherConcern.ToString();

            PAPConcernsIDTextBox.Text = SocioConcernBOObj.PapConcernID.ToString();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// To get Socio Concern
        /// </summary>
        /// <param name="HHID"></param>
        /// <returns></returns>
        public SocioConcernList getSocioConcern(int HHID)
        {
            // used in Master page
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = " USP_TRN_GETSOCIALCONCERNS";

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("HHID_", HHID);
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;

            cmd.Connection.Open();
            OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            SocioConcernBO   objSocioConcern  = null;
            SocioConcernList SocioConcernList = new SocioConcernList();

            while (dr.Read())
            {
                objSocioConcern = new SocioConcernBO();

                if (!dr.IsDBNull(dr.GetOrdinal("PAP_CONCERNID")))
                {
                    objSocioConcern.PapConcernID = dr.GetInt32(dr.GetOrdinal("PAP_CONCERNID"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("HHID")))
                {
                    objSocioConcern.HHID = dr.GetInt32(dr.GetOrdinal("HHID"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("CONCERNID")))
                {
                    objSocioConcern.ConcernID = dr.GetInt32(dr.GetOrdinal("CONCERNID"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("CONCERN")))
                {
                    objSocioConcern.ConcernName = dr.GetString(dr.GetOrdinal("CONCERN"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("OTHERCONCERN")))
                {
                    objSocioConcern.OtherConcern = dr.GetString(dr.GetOrdinal("OTHERCONCERN"));
                }

                SocioConcernList.Add(objSocioConcern);
            }

            dr.Close();

            return(SocioConcernList);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// To Insert Socio Concern
        /// </summary>
        /// <param name="objSocioConcern"></param>
        /// <returns></returns>
        public string InsertSocioConcern(SocioConcernBO objSocioConcern)
        {
            ConcernDAL ConcernDALobj = new ConcernDAL(); //Data pass -to Database Layer

            try
            {
                return(ConcernDALobj.InsertSocioConcern(objSocioConcern));
            }
            catch
            {
                throw;
            }
            finally
            {
                ConcernDALobj = null;
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// To Edit Socio Concern
        /// </summary>
        /// <param name="objSocioConcern"></param>
        /// <returns></returns>
        public string EditSocioConcern(SocioConcernBO objSocioConcern)
        {
            string returnResult = string.Empty;

            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);

            cnn.Open();
            OracleCommand dcmd = new OracleCommand("USP_TRN_UPDATE_SOCIAL_CONCER", cnn);

            dcmd.CommandType = CommandType.StoredProcedure;
            int count = Convert.ToInt32(dcmd.CommandType);

            try
            {
                dcmd.Parameters.Add("PapConcernID_", objSocioConcern.PapConcernID);
                dcmd.Parameters.Add("HHID_", objSocioConcern.HHID);
                dcmd.Parameters.Add("ConcernID_", objSocioConcern.ConcernID);
                dcmd.Parameters.Add("OtherConcern_", objSocioConcern.OtherConcern);
                dcmd.Parameters.Add("UpdatedBY", objSocioConcern.UserID);

                dcmd.Parameters.Add("errorMessage_", OracleDbType.Varchar2, 500).Direction = ParameterDirection.Output;

                dcmd.ExecuteNonQuery();

                if (dcmd.Parameters["errorMessage_"].Value != null)
                {
                    returnResult = dcmd.Parameters["errorMessage_"].Value.ToString();
                }
                else
                {
                    returnResult = string.Empty;
                }
            }
            catch
            {
                throw;
            }
            finally
            {
                dcmd.Dispose();
                cnn.Close();
                cnn.Dispose();
            }

            return(returnResult);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// To Get Socio Concern By Id
        /// </summary>
        /// <param name="PapConcernID"></param>
        /// <param name="HHID"></param>
        /// <returns></returns>
        public SocioConcernBO GetSocioConcernById(int PapConcernID, int HHID)
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = "USP_MST_GET_SOC_CONCERN_ID";

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("PapConcernID_", PapConcernID);
            cmd.Parameters.Add("HHID_", HHID);
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;

            cmd.Connection.Open();

            OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            SocioConcernBO   SocioConcernObj  = null;
            SocioConcernList SocioConcernList = new SocioConcernList();

            SocioConcernObj = new SocioConcernBO();
            while (dr.Read())
            {
                if (ColumnExists(dr, "OTHERCONCERN") && !dr.IsDBNull(dr.GetOrdinal("OTHERCONCERN")))
                {
                    SocioConcernObj.OtherConcern = dr.GetString(dr.GetOrdinal("OTHERCONCERN"));
                }
                if (ColumnExists(dr, "PAP_CONCERNID") && !dr.IsDBNull(dr.GetOrdinal("PAP_CONCERNID")))
                {
                    SocioConcernObj.PapConcernID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("PAP_CONCERNID")));
                }
                if (ColumnExists(dr, "CONCERNID") && !dr.IsDBNull(dr.GetOrdinal("CONCERNID")))
                {
                    SocioConcernObj.ConcernID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("CONCERNID")));
                }
            }
            dr.Close();
            return(SocioConcernObj);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// To Edit Socio Concern
        /// </summary>
        /// <param name="objSocioConcern"></param>
        /// <returns></returns>
        public string EditSocioConcern(SocioConcernBO objSocioConcern)
        {
            ConcernDAL ConcernDALobj = new ConcernDAL();

            return(ConcernDALobj.EditSocioConcern(objSocioConcern));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// to save the data
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        protected void btnSave_Click(object sender, EventArgs e)
        {
            string message      = string.Empty;
            string AlertMessage = string.Empty;

            string uID  = Session["USER_ID"].ToString();
            string HHID = Session["HH_ID"].ToString();

            SocioConcernBO objSocioConcern = new SocioConcernBO();

            if (PAPConcernsIDTextBox.Text != "0")
            {
                objSocioConcern.PapConcernID = Convert.ToInt32(ViewState["PapConcernID"]);
                objSocioConcern.ConcernID    = Convert.ToInt32(PAPConcernsDropDownList.SelectedItem.Value.ToString().Trim());
                string strMax = PAPOtherConcernsTextBox.Text.Trim();
                if (strMax.Trim().Length >= 500)
                {
                    strMax = PAPOtherConcernsTextBox.Text.ToString().Trim().Substring(0, 500);
                }
                objSocioConcern.OtherConcern = strMax;
                objSocioConcern.UserID       = Convert.ToInt32(uID);
                objSocioConcern.HHID         = Convert.ToInt32(HHID);

                SocioConcernBLL SocioConcernobj = new SocioConcernBLL();
                message = SocioConcernobj.EditSocioConcern(objSocioConcern);
                if (string.IsNullOrEmpty(message) || message == "" || message == "null")
                {
                    message = "Data updated successfully";
                }

                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('" + message + "');", true);
                PAPConcernsIDTextBox.Text = "0";
                BindGrid();
                SetUpdateMode(false);
                clear();
            }
            else
            {
                objSocioConcern.ConcernID = Convert.ToInt32(PAPConcernsDropDownList.SelectedItem.Value.ToString().Trim());
                string strMax = PAPOtherConcernsTextBox.Text.Trim();
                if (strMax.Trim().Length >= 500)
                {
                    strMax = PAPOtherConcernsTextBox.Text.ToString().Trim().Substring(0, 500);
                }
                objSocioConcern.OtherConcern = strMax;
                objSocioConcern.UserID       = Convert.ToInt32(uID);
                objSocioConcern.HHID         = Convert.ToInt32(HHID);

                SocioConcernBLL SocioConcernobj = new SocioConcernBLL();
                message = SocioConcernobj.InsertSocioConcern(objSocioConcern);

                if (string.IsNullOrEmpty(message) || message == "" || message == "null")
                {
                    message = "Data saved successfully";
                }

                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('" + message + "');", true);
                clear();
                BindGrid();
                SetUpdateMode(false);
            }

            ChangeRequestStatusSocailConcerns();
            projectFrozen();
        }