Ejemplo n.º 1
0
        public List <clsSupplierMasterMember> GetSupplier()
        {
            List <clsSupplierMasterMember> objList = new List <clsSupplierMasterMember>();

            try
            {
                clsSqlHelper   objSql    = new clsSqlHelper(clsHelper.DBCONNTYPE.GetConnString);
                SqlParameter[] objParams = new SqlParameter[]
                {
                    new SqlParameter("@SupplierID", SupplierID),

                    new SqlParameter("@UserID", UserID),
                    new SqlParameter("@CompanyID", CompanyID),
                    new SqlParameter("@Action", Mode)
                };

                DataSet ds = objSql.ExecuteDataSet("SupplierMasterGet", objParams);

                if (ds != null)
                {
                    clsSupplierMasterMember objSupplier = new clsSupplierMasterMember();

                    #region Supplier
                    if (ds.Tables.Count > 0)
                    {
                        foreach (DataRow r in ds.Tables[1].Rows)
                        {
                            objSupplier.SupplierID        = Convert.ToInt32(r["SupplierID"] ?? -1);
                            objSupplier.SupplierName      = (r["SupplierName"] ?? "").ToString();
                            objSupplier.SupplierAddress   = (r["SupplierAddress"] ?? "").ToString();
                            objSupplier.SupplierStateFKey = Convert.ToInt32(r["SupplierStateFKey"] ?? -1);
                            objSupplier.SupplierCityFKey  = Convert.ToInt32(r["SupplierCityFKey"] ?? -1);
                            objSupplier.SupplierAreaFKey  = Convert.ToInt32(r["SupplierAreaFKey"] ?? -1);
                            objSupplier.SupplierContactNo = (r["SupplierContactNo"] ?? "").ToString();
                            objSupplier.SupplierEmail     = (r["SupplierEmail"] ?? "").ToString();
                            objSupplier.SupplierGSTNo     = (r["SupplierGSTNo"] ?? "").ToString();
                            objSupplier.SupplierCSTNo     = (r["SupplierCSTNo"] ?? "").ToString();
                            objSupplier.SupplierIsActive  = Convert.ToInt32(r["SupplierActive"] ?? 0);
                            objSupplier.CompanyID         = Convert.ToInt32(r["CompanyID"] ?? 0);
                            objSupplier.SupplierGSTDate   = (r["SupplierGSTDate"] ?? "").ToString();
                            objSupplier.SupplierCSTDate   = (r["SupplierCSTDate"] ?? "").ToString();
                            objSupplier.SupplierDetai     = (r["SupplierDetai"] ?? "").ToString();
                            objList.Add(objSupplier);
                        }
                    }

                    #endregion
                }

                return(objList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
        public List <clsSupplierMasterMember> GetSupplierDetail()
        {
            List <clsSupplierMasterMember> objList = new List <clsSupplierMasterMember>();

            try
            {
                clsSqlHelper   objSql    = new clsSqlHelper(clsHelper.DBCONNTYPE.GetConnString);
                SqlParameter[] objParams = new SqlParameter[]
                {
                    new SqlParameter("@SupplierID", SupplierID),

                    new SqlParameter("@UserID", UserID),
                    new SqlParameter("@CompanyID", CompanyID),
                    new SqlParameter("@Action", Mode)
                };

                DataSet ds = objSql.ExecuteDataSet("SupplierMasterGet", objParams);

                if (ds != null)
                {
                    clsSupplierMasterMember objSupplier = new clsSupplierMasterMember();

                    #region Supplier
                    if (ds.Tables.Count > 0)
                    {
                        foreach (DataRow r in ds.Tables[0].Rows)
                        {
                            objSupplier.SupplierDetai = (r["SupplierDetai"] ?? "").ToString();
                            objList.Add(objSupplier);
                        }
                    }

                    #endregion
                }

                return(objList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }