예제 #1
0
        /// <summary>
        /// To fetch details from database based on ID
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GetModeofPaymentIDByID()
        {
            ModeofPaymentBLL ModeofPaymentBLLobj = new ModeofPaymentBLL();
            int ModeofPaymentID = 0;

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

            ModeofPaymentBO ModeofPaymentObj = new ModeofPaymentBO();

            ModeofPaymentObj = ModeofPaymentBLLobj.GetModeofPaymentID(ModeofPaymentID);

            rdoTypeInKind.Checked = false;
            rdoTypeCash.Checked   = false;
            if (ModeofPaymentObj.PaymentType.ToUpper() == "IN KIND")
            {
                rdoTypeInKind.Checked = true;
            }
            else
            {
                rdoTypeCash.Checked = true;
            }

            txtModeofPayment.Text   = ModeofPaymentObj.ModeofPayment;
            txtModeofPaymentID.Text = ModeofPaymentObj.ModeofPaymentID.ToString();
        }
예제 #2
0
        //get all data in mst_Concern table using USP_MST_SELECTCONCERN-SP
        /// <summary>
        /// To Get Mode of Payment
        /// </summary>
        /// <returns></returns>
        public ModeofPaymentList GetModeofPayment()
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = "USP_MST_SELECTMODEOFPAYMENT";

            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);
            ModeofPaymentBO   objModeofPayment  = null;
            ModeofPaymentList ModeofPaymentList = new ModeofPaymentList();

            while (dr.Read())
            {
                objModeofPayment = new ModeofPaymentBO();
                objModeofPayment.ModeofPaymentID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("MODEOFPAYMENTID")));
                objModeofPayment.ModeofPayment   = dr.GetString(dr.GetOrdinal("MODEOFPAYMENT"));
                objModeofPayment.PaymentType     = dr.GetString(dr.GetOrdinal("TYPEOFPAYMENT"));
                objModeofPayment.IsDeleted       = dr.GetString(dr.GetOrdinal("ISDELETED"));

                ModeofPaymentList.Add(objModeofPayment);
            }

            dr.Close();

            return(ModeofPaymentList);
        }
예제 #3
0
        public string EDITMODEOFPAYMENT(ModeofPaymentBO ModeofPaymentBOObj)
        {
            string returnResult = string.Empty;

            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);

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

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

            try
            {
                dcmd.Parameters.Add("TYPEOFPAYMENT_", ModeofPaymentBOObj.PaymentType);
                dcmd.Parameters.Add("MODEOFPAYMENT_", ModeofPaymentBOObj.ModeofPayment);
                dcmd.Parameters.Add("MODEOFPAYMENTID_", ModeofPaymentBOObj.ModeofPaymentID);
                dcmd.Parameters.Add("UpdatedBY", ModeofPaymentBOObj.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);
        }
예제 #4
0
        /// <summary>
        /// To EDIT MODE OF PAYMENT
        /// </summary>
        /// <param name="ModeofPaymentBOObj"></param>
        /// <returns></returns>
        public string EDITMODEOFPAYMENT(ModeofPaymentBO ModeofPaymentBOObj)
        {
            ModeofPaymentDAL ModeofPaymentDALObj = new ModeofPaymentDAL();//Data pass -to Database Layer

            try
            {
                return(ModeofPaymentDALObj.EDITMODEOFPAYMENT(ModeofPaymentBOObj));
            }
            catch
            {
                throw;
            }
            finally
            {
                ModeofPaymentDALObj = null;
            }
        }
예제 #5
0
        /// <summary>
        /// To Insert Mode of Payment
        /// </summary>
        /// <param name="ModeofPaymentBOObj"></param>
        /// <returns></returns>
        public string InsertModeofPayment(ModeofPaymentBO ModeofPaymentBOObj)
        {
            ModeofPaymentDAL ModeofPaymentDAL = new ModeofPaymentDAL(); //Data pass -to Database Layer

            try
            {
                return(ModeofPaymentDAL.InsertModeofPayment(ModeofPaymentBOObj));
            }
            catch
            {
                throw;
            }
            finally
            {
                ModeofPaymentDAL = null;
            }
        }
예제 #6
0
        //get the data in mst_Concern table using USP_MST_GETSELECTCONCERN-SP signal Data based on ID
        public ModeofPaymentBO GetModeofPaymentID(int ModeofPaymentID)
        {
            OracleConnection cnn = new OracleConnection(AppConfiguration.ConnectionString);
            OracleCommand    cmd;

            string proc = "USP_MST_GETSELECTMODEOFPAY";

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

            cmd.Connection.Open();

            OracleDataReader  dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            ModeofPaymentBO   ModeofPaymentBOObj = null;
            ModeofPaymentList ModeofPaymentList  = new ModeofPaymentList();

            ModeofPaymentBOObj = new ModeofPaymentBO();
            while (dr.Read())
            {
                if (!dr.IsDBNull(dr.GetOrdinal("TYPEOFPAYMENT")))
                {
                    ModeofPaymentBOObj.PaymentType = dr.GetString(dr.GetOrdinal("TYPEOFPAYMENT"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("MODEOFPAYMENT")))
                {
                    ModeofPaymentBOObj.ModeofPayment = dr.GetString(dr.GetOrdinal("MODEOFPAYMENT"));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("MODEOFPAYMENTID")))
                {
                    ModeofPaymentBOObj.ModeofPaymentID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("MODEOFPAYMENTID")));
                }
                if (!dr.IsDBNull(dr.GetOrdinal("ISDELETED")))
                {
                    ModeofPaymentBOObj.IsDeleted = dr.GetString(dr.GetOrdinal("ISDELETED"));
                }
            }
            dr.Close();
            return(ModeofPaymentBOObj);
        }
예제 #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;

            ModeofPaymentBLL ModeofPaymentBLLOBJ = new ModeofPaymentBLL();
            ModeofPaymentBO  ModeofPaymentBOObj  = new ModeofPaymentBO();

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

            if (txtModeofPaymentID.Text.ToString().Trim() == "0")
            {
                try
                {
                    if (rdoTypeInKind.Checked)
                    {
                        ModeofPaymentBOObj.PaymentType = rdoTypeInKind.Text;
                    }
                    else
                    {
                        ModeofPaymentBOObj.PaymentType = rdoTypeCash.Text;
                    }

                    ModeofPaymentBOObj.ModeofPayment = txtModeofPayment.Text.ToString().Trim();
                    ModeofPaymentBOObj.UserID        = uID;
                    message = ModeofPaymentBLLOBJ.InsertModeofPayment(ModeofPaymentBOObj);

                    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();
                        txtModeofPaymentID.Text = "0";
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    ModeofPaymentBLLOBJ = null;
                }
            }
            else
            {
                try
                {
                    if (rdoTypeInKind.Checked)
                    {
                        ModeofPaymentBOObj.PaymentType = rdoTypeInKind.Text;
                    }
                    else
                    {
                        ModeofPaymentBOObj.PaymentType = rdoTypeCash.Text;
                    }

                    ModeofPaymentBOObj.ModeofPayment   = txtModeofPayment.Text.ToString().Trim();
                    ModeofPaymentBOObj.ModeofPaymentID = Convert.ToInt32(txtModeofPaymentID.Text.ToString().Trim());
                    ModeofPaymentBOObj.UserID          = Convert.ToInt32(uID);

                    message = ModeofPaymentBLLOBJ.EDITMODEOFPAYMENT(ModeofPaymentBOObj);

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

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