Exemplo n.º 1
0
        /// <summary>
        /// To Get All Land Received
        /// </summary>
        /// <returns></returns>
        public LandReceivedMSTList GetAllLandReceived()
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = "USP_MST_SELECTLANDRECDALL";

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

            cmd.Connection.Open();
            OracleDataReader    dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            LandReceivedMSTBO   objLandReceived     = null;
            LandReceivedMSTList LandReceivedMSTList = new LandReceivedMSTList();

            while (dr.Read())
            {
                objLandReceived = new LandReceivedMSTBO();
                objLandReceived.LandReceivedID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("LANDRECDFROMID")));
                objLandReceived.LandReceived   = dr.GetString(dr.GetOrdinal("LANDRECDFROM"));
                objLandReceived.IsDeleted      = dr.GetString(dr.GetOrdinal("ISDELETED"));

                LandReceivedMSTList.Add(objLandReceived);
            }

            dr.Close();

            return(LandReceivedMSTList);
        }
Exemplo n.º 2
0
        /// <summary>
        /// To EDIT LAND RECEIVED
        /// </summary>
        /// <param name="LandReceivedMSTBOObj"></param>
        /// <returns></returns>
        public string EDITLANDRECEIVED(LandReceivedMSTBO LandReceivedMSTBOObj)
        {
            LandReceivedMSTDAL LandReceivedMSTDALOBJ = new LandReceivedMSTDAL(); //Data pass -to Database Layer

            try
            {
                return(LandReceivedMSTDALOBJ.EDITLANDRECEIVED(LandReceivedMSTBOObj));
            }
            catch
            {
                throw;
            }
            finally
            {
                LandReceivedMSTDALOBJ = null;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// To Insert Land Received
        /// </summary>
        /// <param name="LandReceivedMSTBOObj"></param>
        /// <returns></returns>
        public string InsertLandReceived(LandReceivedMSTBO LandReceivedMSTBOObj)
        {
            LandReceivedMSTDAL LandReceivedMSTDAL = new LandReceivedMSTDAL(); //Data pass -to Database Layer

            try
            {
                return(LandReceivedMSTDAL.InsertLandReceived(LandReceivedMSTBOObj));
            }
            catch
            {
                throw;
            }
            finally
            {
                LandReceivedMSTDAL = null;
            }
        }
Exemplo n.º 4
0
        public string EDITLANDRECEIVED(LandReceivedMSTBO LandReceivedMSTBOObj)
        {
            string returnResult = string.Empty;

            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);

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

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

            try
            {
                dcmd.Parameters.Add("LandReceived_", LandReceivedMSTBOObj.LandReceived);
                dcmd.Parameters.Add("LandReceivedID_", LandReceivedMSTBOObj.LandReceivedID);
                dcmd.Parameters.Add("UpdatedBY", LandReceivedMSTBOObj.UserID);
                //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
            {
                throw;
            }
            finally
            {
                dcmd.Dispose();
                cnn.Close();
                cnn.Dispose();
            }

            return(returnResult);
        }
Exemplo n.º 5
0
        /// <summary>
        ///To fetch details from database based on ID
        /// </summary
        private void GetLandReceivedByID()
        {
            LandReceivedMSTBLL LandReceivedMSTOBJ = new LandReceivedMSTBLL();

            int LandReceivedID = 0;

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

            LandReceivedMSTBO LandReceivedObj = new LandReceivedMSTBO();

            LandReceivedObj = LandReceivedMSTOBJ.GetLandReceivedByID(LandReceivedID);

            txtLandReceived.Text   = LandReceivedObj.LandReceived;
            txtLandReceivedID.Text = LandReceivedObj.LandReceivedID.ToString();
        }
Exemplo n.º 6
0
        //get the data in mst_Concern table using USP_MST_GETSELECTCONCERN-SP signal Data based on ID
        public LandReceivedMSTBO GetLandReceivedByID(int LandReceivedID)
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = "USP_MST_GETSELECTLANDRECD";

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

            cmd.Connection.Open();

            OracleDataReader    dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            LandReceivedMSTBO   LandReceivedMSTBOObj = null;
            LandReceivedMSTList LandReceivedMSTList  = new LandReceivedMSTList();

            LandReceivedMSTBOObj = new LandReceivedMSTBO();
            while (dr.Read())
            {
                if (ColumnExists(dr, "LANDRECDFROM") && !dr.IsDBNull(dr.GetOrdinal("LANDRECDFROM")))
                {
                    LandReceivedMSTBOObj.LandReceived = dr.GetString(dr.GetOrdinal("LANDRECDFROM"));
                }
                if (ColumnExists(dr, "LANDRECDFROMID") && !dr.IsDBNull(dr.GetOrdinal("LANDRECDFROMID")))
                {
                    LandReceivedMSTBOObj.LandReceivedID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("LANDRECDFROMID")));
                }
                if (ColumnExists(dr, "ISDELETED") && !dr.IsDBNull(dr.GetOrdinal("ISDELETED")))
                {
                    LandReceivedMSTBOObj.IsDeleted = dr.GetString(dr.GetOrdinal("ISDELETED"));
                }
            }
            dr.Close();
            return(LandReceivedMSTBOObj);
        }
Exemplo n.º 7
0
        /// <summary>
        /// To save details to database
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string             AlertMessage         = string.Empty;
            string             message              = string.Empty;
            LandReceivedMSTBLL LandReceivedMSTOBJ   = new LandReceivedMSTBLL();
            LandReceivedMSTBO  LandReceivedMSTBOObj = new LandReceivedMSTBO();

            int uID = Convert.ToInt32(Session["USER_ID"].ToString());

            if (txtLandReceivedID.Text.ToString().Trim() == string.Empty)
            {
                try
                {
                    LandReceivedMSTBOObj.LandReceived = txtLandReceived.Text.ToString().Trim();
                    LandReceivedMSTBOObj.UserID       = uID;
                    message = LandReceivedMSTOBJ.InsertLandReceived(LandReceivedMSTBOObj);

                    AlertMessage = "alert('" + message + "');";

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

                    if (message != "")
                    {
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('" + message + "');", true);
                        Clear();
                        BindGrid();
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                finally
                {
                    LandReceivedMSTOBJ = null;
                }
            }
            else
            {
                try
                {
                    LandReceivedMSTBOObj.LandReceived   = txtLandReceived.Text.ToString().Trim();
                    LandReceivedMSTBOObj.LandReceivedID = Convert.ToInt32(txtLandReceivedID.Text.ToString().Trim());
                    LandReceivedMSTBOObj.UserID         = Convert.ToInt32(uID);

                    message = LandReceivedMSTOBJ.EDITLANDRECEIVED(LandReceivedMSTBOObj);

                    if (string.IsNullOrEmpty(message) || message == "" || message == "null")
                    {
                        message = "Data updated successfully";
                        // ClearDetails();
                        Clear();
                        SetUpdateMode(false);
                        BindGrid();
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }

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