Esempio n. 1
0
        //---------Get Unit Details--------
        public UnitMast Unit_GetById(int?pid)
        {
            DataTable dt   = null;
            UnitMast  unit = null;

            try
            {
                cmd.Parameters.AddWithValue("@Pid", pid);
                cmd.Parameters.AddWithValue("@Action", "SHOW");
                conn.Open();
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                dt = new DataTable();
                da.Fill(dt);
                unit = GetList.DataTableToList <UnitMast>(dt).FirstOrDefault();

                return(unit);
            }
            catch
            {
                return(unit);
            }
            finally
            {
                conn.Close();
            }
        }
Esempio n. 2
0
        //---------Get Country--------
        public Country Country_GetById(int?id)
        {
            DataTable dt      = null;
            Country   country = null;

            try
            {
                conn.Open();
                cmd.Parameters.AddWithValue("@Pid", id);
                cmd.Parameters.AddWithValue("@Action", "SHOW");
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                dt = new DataTable();
                da.Fill(dt);
                country = GetList.DataTableToList <Country>(dt).FirstOrDefault();
                return(country);
            }
            catch
            {
                return(country);
            }
            finally
            {
                conn.Close();
            }
        }
Esempio n. 3
0
        //---------Get CostPrice Details--------
        public CPMaster CostPrice_GetById(int?pid)
        {
            DataTable dt        = null;
            CPMaster  costPrice = null;

            try
            {
                cmd.Parameters.AddWithValue("@Pid", pid);
                cmd.Parameters.AddWithValue("@Action", "SHOW");
                conn.Open();
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                dt = new DataTable();
                da.Fill(dt);
                costPrice = GetList.DataTableToList <CPMaster>(dt).FirstOrDefault();

                return(costPrice);
            }
            catch
            {
                return(costPrice);
            }
            finally
            {
                conn.Close();
            }
        }
Esempio n. 4
0
        //---------Get Unit Details--------
        public Warehousemast WareHouse_GetById(int?pid)
        {
            DataTable     dt        = null;
            Warehousemast WareHouse = null;

            try
            {
                cmd.Parameters.AddWithValue("@Pid", pid);
                cmd.Parameters.AddWithValue("@Action", "SHOW");
                conn.Open();
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                dt = new DataTable();
                da.Fill(dt);
                WareHouse = GetList.DataTableToList <Warehousemast>(dt).FirstOrDefault();

                return(WareHouse);
            }
            catch
            {
                return(WareHouse);
            }
            finally
            {
                conn.Close();
            }
        }
Esempio n. 5
0
        //---------Get Buyer Details--------
        public Buyer Buyer_GetById(int?id)
        {
            DataTable dt    = null;
            Buyer     buyer = null;

            try
            {
                cmd.Parameters.AddWithValue("@Pid", id);
                cmd.Parameters.AddWithValue("@Action", "SELECT");
                conn.Open();
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                dt = new DataTable();
                da.Fill(dt);
                buyer = GetList.DataTableToList <Buyer>(dt).FirstOrDefault();

                return(buyer);
            }
            catch
            {
                return(buyer);
            }
            finally
            {
                conn.Close();
            }
        }