Exemplo n.º 1
0
		public void AssignUserSession(Int64 UID)
		{
			
			AccessUser clsAccessUser = new AccessUser();
			AccessUserDetails clsDetails = clsAccessUser.Details(UID);
			clsAccessUser.CommitAndDispose();

			Session.RemoveAll();
            Session.Add("BranchID", Constants.BRANCH_ID_MAIN);
            Session.Add("TerminalNo", Constants.C_DEFAULT_TERMINAL_01);

            Session.Add("AccessUserDetails", clsDetails);

			Session.Add("PageSize",clsDetails.PageSize);
			Session.Add("UID", UID);
			Session.Add("UserName", clsDetails.UserName);
			Session.Add("Password", clsDetails.Password);
			Session.Add("Name",clsDetails.Name);

			Session.Add("CountryID", clsDetails.CountryID);

			Session.Add("Addres1", clsDetails.Address1);
			Session.Add("Addres2", clsDetails.Address2);
			Session.Add("City", clsDetails.City);
			Session.Add("State", clsDetails.State);
			Session.Add("OfficePhone", clsDetails.OfficePhone);
			Session.Add("DirectPhone", clsDetails.DirectPhone);
			Session.Add("HomePhone", clsDetails.HomePhone);
			Session.Add("FaxPhone", clsDetails.FaxPhone);
			Session.Add("MobilePhone", clsDetails.MobilePhone);
			Session.Add("EmailAddress", clsDetails.EmailAddress);

            //Data.SysConfig clsSysConfig = new Data.SysConfig();
            //Session.Add(Constants.SYS_CONFIG_BACKEND_VARIATION_TYPE, clsSysConfig.get_BackendVariationType());
            //clsSysConfig.CommitAndDispose();

            //overwrite the companydetails from the database
            Data.SysConfig clsSysConfig = new Data.SysConfig();
            Data.SysConfigDetails clsSysConfigDetails = clsSysConfig.get_SysConfigDetails();
            clsSysConfig.CommitAndDispose();

            Session.Add(Constants.SYS_CONFIG_BACKEND_VARIATION_TYPE, clsSysConfigDetails.BACKEND_VARIATION_TYPE);

            CompanyDetails.BECompanyCode = string.IsNullOrEmpty(clsSysConfigDetails.BECompanyCode) ? CompanyDetails.BECompanyCode : clsSysConfigDetails.BECompanyCode;
            CompanyDetails.CompanyCode = string.IsNullOrEmpty(clsSysConfigDetails.CompanyCode) ? CompanyDetails.CompanyCode : clsSysConfigDetails.CompanyCode;
            CompanyDetails.CompanyName = string.IsNullOrEmpty(clsSysConfigDetails.CompanyName) ? CompanyDetails.CompanyName : clsSysConfigDetails.CompanyName;
            CompanyDetails.Currency = string.IsNullOrEmpty(clsSysConfigDetails.Currency) ? CompanyDetails.Currency : clsSysConfigDetails.Currency;
            CompanyDetails.TIN = string.IsNullOrEmpty(clsSysConfigDetails.TIN) ? CompanyDetails.TIN : clsSysConfigDetails.TIN;

            CompanyDetails.Address1 = string.IsNullOrEmpty(clsSysConfigDetails.Address1) ? CompanyDetails.Address1 : clsSysConfigDetails.Address1;
            CompanyDetails.Address2 = string.IsNullOrEmpty(clsSysConfigDetails.Address2) ? CompanyDetails.Address2 : clsSysConfigDetails.Address2;
            CompanyDetails.City = string.IsNullOrEmpty(clsSysConfigDetails.City) ? CompanyDetails.City : clsSysConfigDetails.City;
            CompanyDetails.State = string.IsNullOrEmpty(clsSysConfigDetails.State) ? CompanyDetails.State : clsSysConfigDetails.State;
            CompanyDetails.Zip = string.IsNullOrEmpty(clsSysConfigDetails.Zip) ? CompanyDetails.Zip : clsSysConfigDetails.Zip;
            CompanyDetails.Country = string.IsNullOrEmpty(clsSysConfigDetails.Country) ? CompanyDetails.Country : clsSysConfigDetails.Country;
            CompanyDetails.OfficePhone = string.IsNullOrEmpty(clsSysConfigDetails.OfficePhone) ? CompanyDetails.OfficePhone : clsSysConfigDetails.OfficePhone;
            CompanyDetails.DirectPhone = string.IsNullOrEmpty(clsSysConfigDetails.DirectPhone) ? CompanyDetails.DirectPhone : clsSysConfigDetails.DirectPhone;
            CompanyDetails.FaxPhone = string.IsNullOrEmpty(clsSysConfigDetails.FaxPhone) ? CompanyDetails.FaxPhone : clsSysConfigDetails.FaxPhone;
            CompanyDetails.MobilePhone = string.IsNullOrEmpty(clsSysConfigDetails.MobilePhone) ? CompanyDetails.MobilePhone : clsSysConfigDetails.MobilePhone;
            CompanyDetails.EmailAddress = string.IsNullOrEmpty(clsSysConfigDetails.EmailAddress) ? CompanyDetails.EmailAddress : clsSysConfigDetails.EmailAddress;
            CompanyDetails.WebSite = string.IsNullOrEmpty(clsSysConfigDetails.WebSite) ? CompanyDetails.WebSite : clsSysConfigDetails.WebSite;
		}
Exemplo n.º 2
0
        public void AssignUserSession(Int64 UID)
        {
            AccessUser        clsAccessUser = new AccessUser();
            AccessUserDetails clsDetails    = clsAccessUser.Details(UID);

            clsAccessUser.CommitAndDispose();

            Session.RemoveAll();
            Session.Add("BranchID", Constants.BRANCH_ID_MAIN);
            Session.Add("TerminalNo", Constants.C_DEFAULT_TERMINAL_01);

            Session.Add("AccessUserDetails", clsDetails);

            Session.Add("PageSize", clsDetails.PageSize);
            Session.Add("UID", UID);
            Session.Add("UserName", clsDetails.UserName);
            Session.Add("Password", clsDetails.Password);
            Session.Add("Name", clsDetails.Name);

            Session.Add("CountryID", clsDetails.CountryID);

            Session.Add("Addres1", clsDetails.Address1);
            Session.Add("Addres2", clsDetails.Address2);
            Session.Add("City", clsDetails.City);
            Session.Add("State", clsDetails.State);
            Session.Add("OfficePhone", clsDetails.OfficePhone);
            Session.Add("DirectPhone", clsDetails.DirectPhone);
            Session.Add("HomePhone", clsDetails.HomePhone);
            Session.Add("FaxPhone", clsDetails.FaxPhone);
            Session.Add("MobilePhone", clsDetails.MobilePhone);
            Session.Add("EmailAddress", clsDetails.EmailAddress);

            //Data.SysConfig clsSysConfig = new Data.SysConfig();
            //Session.Add(Constants.SYS_CONFIG_BACKEND_VARIATION_TYPE, clsSysConfig.get_BackendVariationType());
            //clsSysConfig.CommitAndDispose();

            //overwrite the companydetails from the database
            Data.SysConfig        clsSysConfig        = new Data.SysConfig();
            Data.SysConfigDetails clsSysConfigDetails = clsSysConfig.get_SysConfigDetails();
            clsSysConfig.CommitAndDispose();

            Session.Add(Constants.SYS_CONFIG_BACKEND_VARIATION_TYPE, clsSysConfigDetails.BACKEND_VARIATION_TYPE);

            CompanyDetails.BECompanyCode = string.IsNullOrEmpty(clsSysConfigDetails.BECompanyCode) ? CompanyDetails.BECompanyCode : clsSysConfigDetails.BECompanyCode;
            CompanyDetails.CompanyCode   = string.IsNullOrEmpty(clsSysConfigDetails.CompanyCode) ? CompanyDetails.CompanyCode : clsSysConfigDetails.CompanyCode;
            CompanyDetails.CompanyName   = string.IsNullOrEmpty(clsSysConfigDetails.CompanyName) ? CompanyDetails.CompanyName : clsSysConfigDetails.CompanyName;
            CompanyDetails.Currency      = string.IsNullOrEmpty(clsSysConfigDetails.Currency) ? CompanyDetails.Currency : clsSysConfigDetails.Currency;
            CompanyDetails.TIN           = string.IsNullOrEmpty(clsSysConfigDetails.TIN) ? CompanyDetails.TIN : clsSysConfigDetails.TIN;

            CompanyDetails.Address1     = string.IsNullOrEmpty(clsSysConfigDetails.Address1) ? CompanyDetails.Address1 : clsSysConfigDetails.Address1;
            CompanyDetails.Address2     = string.IsNullOrEmpty(clsSysConfigDetails.Address2) ? CompanyDetails.Address2 : clsSysConfigDetails.Address2;
            CompanyDetails.City         = string.IsNullOrEmpty(clsSysConfigDetails.City) ? CompanyDetails.City : clsSysConfigDetails.City;
            CompanyDetails.State        = string.IsNullOrEmpty(clsSysConfigDetails.State) ? CompanyDetails.State : clsSysConfigDetails.State;
            CompanyDetails.Zip          = string.IsNullOrEmpty(clsSysConfigDetails.Zip) ? CompanyDetails.Zip : clsSysConfigDetails.Zip;
            CompanyDetails.Country      = string.IsNullOrEmpty(clsSysConfigDetails.Country) ? CompanyDetails.Country : clsSysConfigDetails.Country;
            CompanyDetails.OfficePhone  = string.IsNullOrEmpty(clsSysConfigDetails.OfficePhone) ? CompanyDetails.OfficePhone : clsSysConfigDetails.OfficePhone;
            CompanyDetails.DirectPhone  = string.IsNullOrEmpty(clsSysConfigDetails.DirectPhone) ? CompanyDetails.DirectPhone : clsSysConfigDetails.DirectPhone;
            CompanyDetails.FaxPhone     = string.IsNullOrEmpty(clsSysConfigDetails.FaxPhone) ? CompanyDetails.FaxPhone : clsSysConfigDetails.FaxPhone;
            CompanyDetails.MobilePhone  = string.IsNullOrEmpty(clsSysConfigDetails.MobilePhone) ? CompanyDetails.MobilePhone : clsSysConfigDetails.MobilePhone;
            CompanyDetails.EmailAddress = string.IsNullOrEmpty(clsSysConfigDetails.EmailAddress) ? CompanyDetails.EmailAddress : clsSysConfigDetails.EmailAddress;
            CompanyDetails.WebSite      = string.IsNullOrEmpty(clsSysConfigDetails.WebSite) ? CompanyDetails.WebSite : clsSysConfigDetails.WebSite;
        }