private Company CreateObject(IDataReader objReader)
        {
            Company     objCompany   = new Company();
            NullManager oNullManager = new NullManager(objReader);

            try
            {
                objCompany.CompanyID          = oNullManager.GetInt32("CompanyID");
                objCompany.CompanyName        = oNullManager.GetString("CompanyName");
                objCompany.AddressLine1       = oNullManager.GetString("AddressLine1");
                objCompany.AddressLine2       = oNullManager.GetString("AddressLine2");
                objCompany.Phone              = oNullManager.GetString("Phone");
                objCompany.Fax                = oNullManager.GetString("Fax");
                objCompany.WebSite            = oNullManager.GetString("WebSite");
                objCompany.Email              = oNullManager.GetString("Email");
                objCompany.BusinessSubTypeID  = oNullManager.GetInt32("BusinessSubTypeID");
                objCompany.TradeLicense       = oNullManager.GetString("TradeLicense");
                objCompany.TINno              = oNullManager.GetString("TINno");
                objCompany.IRCNo              = oNullManager.GetString("IRCNo");
                objCompany.ERCNo              = oNullManager.GetString("ERCNo");
                objCompany.MembershipNo1      = oNullManager.GetString("MembershipNo1");
                objCompany.MembershipNo2      = oNullManager.GetString("MembershipNo2");
                objCompany.ContactPerson      = oNullManager.GetString("ContactPerson");
                objCompany.ContactPersonPhone = oNullManager.GetString("ContactPersonPhone");
                objCompany.CompanyLogo        = oNullManager.GetBytes("CompanyLogo");
                objCompany.CurrencyID         = oNullManager.GetInt32("CurrencyID");
            }
            catch (Exception Ex)
            {
                throw new Exception("Error while creating object" + Ex.Message);
            }
            return(objCompany);
        }
        private UserPrivilege CreateObject(IDataReader oReader, bool IsDefault)
        {
            UserPrivilege objUserPrivilege = new UserPrivilege();

            NullManager reader = new NullManager(oReader);

            try
            {
                objUserPrivilege.UserID       = reader.GetInt32("UserID");
                objUserPrivilege.FriendlyName = reader.GetString("FriendlyName");
                objUserPrivilege.CompanyID    = reader.GetInt32("CompanyID");
                if (!IsDefault)
                {
                    objUserPrivilege.CanEdit   = (int)reader.GetByte("CanEdit");
                    objUserPrivilege.CanDelete = (int)reader.GetByte("CanDelete");
                    objUserPrivilege.CanAdd    = (int)reader.GetByte("CanAdd");
                    objUserPrivilege.CanView   = (int)reader.GetByte("CanView");
                }
            }
            catch (Exception Ex)
            {
                throw new Exception("Error while creating object" + Ex.Message);
            }
            return(objUserPrivilege);
        }
Exemple #3
0
        private BusinessType CreateObject(IDataReader objReader)
        {
            BusinessType objBusinessType = new BusinessType();
            NullManager  reader          = new  NullManager(objReader);

            try
            {
                objBusinessType.BusinessTypeID = reader.GetInt32("BusinessTypeID");
                objBusinessType.Name           = reader.GetString("Name");

                objBusinessType.CompanyID    = reader.GetInt32("CompanyID");
                objBusinessType.UserID       = reader.GetInt32("UserID");
                objBusinessType.ModifiedDate = reader.GetDateTime("ModifiedDate");
            }
            catch (Exception Ex)
            {
                throw new Exception("Error while creating object" + Ex.Message);
            }
            return(objBusinessType);
        }
Exemple #4
0
        private User CreateObject(IDataReader oReader)
        {
            User objUser = new User();

            NullManager Reader = new NullManager(oReader);

            try
            {
                objUser.UserID          = Reader.GetInt32("UserID");
                objUser.UserName        = Reader.GetString("UserName");
                objUser.Password        = Reader.GetString("Password");
                objUser.ConfirmPassword = Reader.GetString("ConfirmPassword");
                objUser.Role            = Reader.GetString("Role");
                objUser.CompanyID       = Reader.GetInt32("CompanyID");
            }
            catch (Exception Ex)
            {
                throw new Exception("Error while creating object" + Ex.Message);
            }
            return(objUser);
        }
        private Designation  CreateObject(IDataReader oReader)
        {
            Designation objDesg = new Designation();
            NullManager reader  = new NullManager(oReader);

            try
            {
                objDesg.DesignationID   = reader.GetInt32("DesignationID");
                objDesg.DesignationName = reader.GetString("Name");
                objDesg.PayScaleID      = reader.GetInt32("PayScaleID");

                objDesg.CompanyID    = reader.GetInt32("CompanyID");
                objDesg.UserID       = reader.GetInt32("UserID");
                objDesg.ModifiedDate = reader.GetDateTime("ModifiedDate");
            }
            catch (Exception Ex)
            {
                throw new Exception("Error while creating object" + Ex.Message);
            }
            return(objDesg);
        }