Пример #1
0
        public string GetStoreTree(string parent)
        {
            DataTable       dt        = new DataTable();
            string          returntxt = string.Empty;
            MySQLConnection con       = new MySQLConnection();

            try
            {
                con.open();

                SqlCommand cmd = new SqlCommand("usp_DisplayNTree", con.con);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlParameter parm1 = new SqlParameter("@Parent", Convert.ToInt32(parent));
                parm1.Direction = ParameterDirection.Input;

                SqlParameter parm2 = new SqlParameter("@TreeFor", Convert.ToInt32(1));
                parm2.Direction = ParameterDirection.Input;

                SqlParameter parm = new SqlParameter("@myReturnString", SqlDbType.VarChar, 50000);
                parm.Direction = ParameterDirection.Output;

                cmd.Parameters.Add(parm1);
                cmd.Parameters.Add(parm2);
                cmd.Parameters.Add(parm);

                cmd.ExecuteNonQuery();
                returntxt = Convert.ToString(cmd.Parameters["@myReturnString"].Value);

                cmd.Dispose();
            }
            catch (Exception ex)
            {
            }
            finally
            {
                con.Close();
            }
            return(returntxt);
        }
Пример #2
0
        public string EstatePlotInstallmentsCreate(string fromdate, string todate, string amount, string noOfInstallments)
        {
            DataTable       dt        = new DataTable();
            string          returntxt = string.Empty;
            MySQLConnection con       = new MySQLConnection();

            try
            {
                con.open();

                SqlCommand cmd = new SqlCommand("usp_EstatePlotCreateInstallments", con.con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@NoOfInstallments", noOfInstallments);
                cmd.Parameters.AddWithValue("@Amount", amount);
                cmd.Parameters.AddWithValue("@startingDate", fromdate);
                cmd.Parameters.AddWithValue("@endingDate", todate);



                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(dt);
                if (dt != null && dt.Rows.Count > 0)
                {
                    returntxt = Convert.ToString(dt.Rows[0]["FinalInstallments"]);
                }
                cmd.Dispose();
            }
            catch (Exception ex)
            {
            }
            finally
            {
                con.Close();
            }
            return(returntxt);
        }