예제 #1
0
        /// <summary>
        /// To Get Nature Finance ID
        /// </summary>
        /// <param name="NatureFinanceID"></param>
        /// <returns></returns>
        public NatureofFinancingBO GetNatureFinanceID(int NatureFinanceID)
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = "USP_MST_GET_NATUR_FIN";

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

            cmd.Connection.Open();

            OracleDataReader      dr      = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            NatureofFinancingBO   Boobj   = null;
            NatureofFinancingList Listobj = new NatureofFinancingList();

            Boobj = new NatureofFinancingBO();
            while (dr.Read())
            {
                if (!dr.IsDBNull(dr.GetOrdinal("FINANCENATURE")))
                {
                    Boobj.FINANCENATURE = dr.GetString(dr.GetOrdinal("FINANCENATURE"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("FINANCENATUREID")))
                {
                    Boobj.FINANCENATUREID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("FINANCENATUREID")));
                }
            }
            dr.Close();


            return(Boobj);
        }
예제 #2
0
        /// <summary>
        /// To Get All Nature Finance
        /// </summary>
        /// <param name="financeNature"></param>
        /// <returns></returns>
        public NatureofFinancingList GetnatureAllfinance(string financeNature)
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = "USP_MST_GETALL_FIN_NATURE";

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;
            if (financeNature.ToString() == "")
            {
                cmd.Parameters.Add("@FINANCENATURE_", DBNull.Value);
            }
            else
            {
                cmd.Parameters.Add("@FINANCENATURE_", financeNature.ToString());
            }
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;

            cmd.Connection.Open();
            OracleDataReader      dr      = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            NatureofFinancingBO   Boobj   = null;
            NatureofFinancingList Listobj = new NatureofFinancingList();

            while (dr.Read())
            {
                Boobj = new NatureofFinancingBO();
                if (!dr.IsDBNull(dr.GetOrdinal("FINANCENATUREID")))
                {
                    Boobj.FINANCENATUREID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("FINANCENATUREID")));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("FINANCENATURE")))
                {
                    Boobj.FINANCENATURE = dr.GetString(dr.GetOrdinal("FINANCENATURE"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("ISDELETED")))
                {
                    Boobj.ISDELETED = dr.GetString(dr.GetOrdinal("ISDELETED"));
                }

                Listobj.Add(Boobj);
            }

            dr.Close();

            return(Listobj);
        }
예제 #3
0
        /// <summary>
        /// To Update
        /// </summary>
        /// <param name="BOobj"></param>
        /// <returns></returns>
        public string Update(NatureofFinancingBO BOobj)
        {
            NatureofFinancingDAL DALobj = new NatureofFinancingDAL(); //Data pass -to Database Layer

            try
            {
                return(DALobj.Update(BOobj));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                DALobj = null;
            }
        }
예제 #4
0
        /// <summary>
        /// to fetch details from database
        /// </summary>
        private void GetNatureFinanceDetail()
        {
            NatureofFinancingBLL BLLobj = new NatureofFinancingBLL();
            int NatureFinanceID         = 0;

            if (ViewState["FINANCENATUREID"] != null)
            {
                NatureFinanceID = Convert.ToInt32(ViewState["FINANCENATUREID"]);
            }

            NatureofFinancingBO BOobj = new NatureofFinancingBO();

            BOobj = BLLobj.GetNatureFinanceID(NatureFinanceID);

            NatureTextBox.Text   = BOobj.FINANCENATURE;
            NatureIDTextBox.Text = BOobj.FINANCENATUREID.ToString();
        }
예제 #5
0
        /// <summary>
        /// To Update
        /// </summary>
        /// <param name="BOobj"></param>
        /// <returns></returns>
        public string Update(NatureofFinancingBO BOobj)
        {
            string           returnResult = string.Empty;
            OracleConnection cnn          = new OracleConnection(AppConfiguration.ConnectionString);

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

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

            try
            {
                dcmd.Parameters.Add("F_FINANCENATUREID", BOobj.FINANCENATUREID);
                dcmd.Parameters.Add("F_FINANCENATURE", BOobj.FINANCENATURE);
                dcmd.Parameters.Add("F_UPDATEDBY", BOobj.CREATEDBY);
                //return dcmd.ExecuteNonQuery();
                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 (Exception ex)
            {
                throw ex;
            }
            finally
            {
                dcmd.Dispose();
                cnn.Close();
                cnn.Dispose();
            }
            return(returnResult);
        }
예제 #6
0
        /// <summary>
        /// To save details to database
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

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

            if (NatureIDTextBox.Text.ToString().Trim() == string.Empty)
            {
                NatureofFinancingBLL BLLobj = new NatureofFinancingBLL();

                try
                {
                    string uID = Session["USER_ID"].ToString();
                    NatureofFinancingBO BOobj = new NatureofFinancingBO();
                    BOobj.FINANCENATURE = NatureTextBox.Text;

                    BOobj.CREATEDBY = Convert.ToInt32(uID);

                    NatureofFinancingBLL NatureofFinancingBLLobj = new NatureofFinancingBLL();
                    message = NatureofFinancingBLLobj.Insert(BOobj);

                    if (string.IsNullOrEmpty(message) || message == "" || message == "null")
                    {
                        message = "Data saved successfully";
                        ClearAll();
                        BindGrid(true, true);
                    }
                    //BindGrid(true, true);
                    //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('Vaccination details added successfully');", true);
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                finally
                {
                    BLLobj = null;
                }
            }
            else if (NatureIDTextBox.Text.ToString().Trim() != string.Empty)
            {
                NatureofFinancingBLL BLLobj = new NatureofFinancingBLL();

                try
                {
                    string uID = Session["USER_ID"].ToString();
                    NatureofFinancingBO BOobj = new NatureofFinancingBO();
                    BOobj.FINANCENATURE   = NatureTextBox.Text;
                    BOobj.FINANCENATUREID = Convert.ToInt32(NatureIDTextBox.Text);
                    BOobj.CREATEDBY       = Convert.ToInt32(uID);

                    NatureofFinancingBLL NatureofFinancingBLLobj = new NatureofFinancingBLL();
                    message = NatureofFinancingBLLobj.Update(BOobj);

                    if (string.IsNullOrEmpty(message) || message == "" || message == "null")
                    {
                        message = "Data saved successfully";
                        ClearAll();
                        BindGrid(true, true);
                        SetUpdateMode(false);
                    }
                    //BindGrid(true, true);
                    //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('Vaccination details added successfully');", true);
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                finally
                {
                    BLLobj = null;
                }
            }
            AlertMessage = "alert('" + message + "');";
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", AlertMessage, true);
        }