Exemplo n.º 1
0
        private void PopulateName()
        {
            string ntUser = string.Empty;
            string LANID  = string.Empty;

            ntUser = this.Request.LogonUserIdentity.Name;

            LANID = ntUser.Substring(ntUser.IndexOf("\\") + 1);

            if (LANID != "")
            {
                Session.Add(Global.Parameters.User, LANID);
                // Retrieve First and Last name of user
                User user = new User();
                user.GetByPk(LANID);

                if (user.FirstName.ToString() != "")
                {
                    lblWelcome.Text = "Welcome " + user.FirstName.ToString() + " " + user.LastName.ToString();
                }
                else
                {
                    lblWelcome.Text = "Welcome " + LoginName.ToString();
                }
            }
        }
Exemplo n.º 2
0
        public override bool Collect(AbstractDataCollector <TEntity> collector)
        {
            if (collector == null)
            {
                return(false);
            }

            ActiveCollector = collector;

            ID = ((IDoctorViewer)ActiveCollector.ActiveViewer).ID;

            if (ActiveDBItem == null)
            {
                return(false);
            }

            if (((Person_cu)ActiveDBItem).Doctor_cu == null)
            {
                ((Person_cu)ActiveDBItem).Doctor_cu = new Doctor_cu();
            }

            if (((Person_cu)ActiveDBItem).User_cu == null)
            {
                ((Person_cu)ActiveDBItem).User_cu = new User_cu();
            }

            #region General Person Details

            if (FirstName_P != null)
            {
                ((Person_cu)ActiveDBItem).FirstName_P = FirstName_P.ToString();
            }

            if (SecondName_P != null)
            {
                ((Person_cu)ActiveDBItem).SecondName_P = SecondName_P.ToString();
            }

            if (ThirdName_P != null)
            {
                ((Person_cu)ActiveDBItem).ThirdName_P = ThirdName_P.ToString();
            }

            if (FourthName_P != null)
            {
                ((Person_cu)ActiveDBItem).FourthName_P = FourthName_P.ToString();
            }

            if (Gender != null)
            {
                ((Person_cu)ActiveDBItem).Gender = Convert.ToBoolean(Gender);
            }

            if (MaritalStatusID != null)
            {
                ((Person_cu)ActiveDBItem).MaritalStatus_P_ID = Convert.ToInt32(MaritalStatusID);
            }

            if (BirthDate != null)
            {
                ((Person_cu)ActiveDBItem).BirthDate = Convert.ToDateTime(BirthDate);
            }

            if (Phone1 != null)
            {
                ((Person_cu)ActiveDBItem).Phone1 = Phone1.ToString();
            }

            if (Phone2 != null)
            {
                ((Person_cu)ActiveDBItem).Phone2 = Phone2.ToString();
            }

            if (Address != null)
            {
                ((Person_cu)ActiveDBItem).Address = Address.ToString();
            }

            if (EMail != null)
            {
                ((Person_cu)ActiveDBItem).EMail = EMail.ToString();
            }

            if (IdentificationCardTypeID != null)
            {
                ((Person_cu)ActiveDBItem).IdentificationCardType_P_ID = Convert.ToInt32(IdentificationCardTypeID);
            }

            if (IdentificationCardNumber != null)
            {
                ((Person_cu)ActiveDBItem).IdentificationCardNumber = IdentificationCardNumber.ToString();
            }

            if (IdentificationCardIssuingDate != null)
            {
                ((Person_cu)ActiveDBItem).IdentificationCardIssuingDate = Convert.ToDateTime(IdentificationCardIssuingDate);
            }

            if (IdentificationCardExpirationDate != null)
            {
                ((Person_cu)ActiveDBItem).IdentificationCardExpirationDate = Convert.ToDateTime(IdentificationCardExpirationDate);
            }

            if (Mobile1 != null)
            {
                ((Person_cu)ActiveDBItem).Mobile1 = Mobile1.ToString();
            }

            if (Mobile2 != null)
            {
                ((Person_cu)ActiveDBItem).Mobile2 = Mobile2.ToString();
            }

            ((Person_cu)ActiveDBItem).IsOnDuty = true;

            #endregion

            #region User Details

            if (InternalCode != null)
            {
                ((Person_cu)ActiveDBItem).User_cu.InternalCode = InternalCode.ToString();
            }

            if (LoginName != null)
            {
                ((Person_cu)ActiveDBItem).User_cu.LoginName = LoginName.ToString();
            }

            if (Password != null)
            {
                ((Person_cu)ActiveDBItem).User_cu.Password = Password.ToString();
            }

            ((Person_cu)ActiveDBItem).User_cu.OragnizationID = (int)ApplicationStaticConfiguration.Organization;

            ((Person_cu)ActiveDBItem).User_cu.IsOnDuty = true;

            #endregion

            #region Doctor Details

            if (InternalCode != null)
            {
                ((Person_cu)ActiveDBItem).Doctor_cu.InternalCode = InternalCode.ToString();
            }

            if (DoctorRankID != null)
            {
                ((Person_cu)ActiveDBItem).Doctor_cu.DoctorRank_P_ID = Convert.ToInt32(DoctorRankID);
            }

            if (DoctorSpecializationID != null)
            {
                ((Person_cu)ActiveDBItem).Doctor_cu.DoctorSpecialization_P_ID = Convert.ToInt32(DoctorSpecializationID);
            }

            if (DoctorCategoryID != null)
            {
                ((Person_cu)ActiveDBItem).Doctor_cu.DoctorCategory_CU_ID = Convert.ToInt32(DoctorCategoryID);
            }

            if (DoctorProfessionalFees != null)
            {
                ((Person_cu)ActiveDBItem).Doctor_cu.DoctorProfessionalFeesIssuingType_P_ID = Convert.ToInt32(DoctorProfessionalFees);
            }

            if (DoctorTaxTypeID != null)
            {
                ((Person_cu)ActiveDBItem).Doctor_cu.DoctorTaxType_CU_ID = Convert.ToInt32(DoctorTaxTypeID);
            }

            if (PrivateMobile != null)
            {
                ((Person_cu)ActiveDBItem).Doctor_cu.PrivateMobile = PrivateMobile.ToString();
            }

            if (Description != null)
            {
                ((Person_cu)ActiveDBItem).Doctor_cu.Description = Description.ToString();
            }

            ((Person_cu)ActiveDBItem).Doctor_cu.IsOnDuty = true;

            #endregion

            switch (((IDoctorViewer)ActiveCollector.ActiveViewer).CommonTransactionType)
            {
            case DB_CommonTransactionType.DeleteExisting:
                ((Person_cu)ActiveDBItem).IsOnDuty           = false;
                ((Person_cu)ActiveDBItem).User_cu.IsOnDuty   = false;
                ((Person_cu)ActiveDBItem).Doctor_cu.IsOnDuty = false;
                break;
            }

            RelatedViewers = ((IDoctorViewer)ActiveCollector.ActiveViewer).RelatedViewers;

            return(true);
        }
Exemplo n.º 3
0
        public override bool Collect(AbstractDataCollector <TEntity> collector)
        {
            if (collector == null)
            {
                return(false);
            }

            ActiveCollector = collector;

            if (Password == null || PasswordConfirmation == null || Password.ToString() != PasswordConfirmation.ToString())
            {
                return(false);
            }

            ID = ((IUserViewer)ActiveCollector.ActiveViewer).ID;

            if (ActiveDBItem == null)
            {
                return(false);
            }

            if (FirstName != null)
            {
                ((Person_cu)ActiveDBItem).FirstName_P = FirstName.ToString();
            }

            if (SecondName != null)
            {
                ((Person_cu)ActiveDBItem).SecondName_P = SecondName.ToString();
            }

            if (ThirdName != null)
            {
                ((Person_cu)ActiveDBItem).ThirdName_P = ThirdName.ToString();
            }

            if (FourthName != null)
            {
                ((Person_cu)ActiveDBItem).FourthName_P = FourthName.ToString();
            }

            if (MaritalStatus != null)
            {
                ((Person_cu)ActiveDBItem).MaritalStatus_P_ID = Convert.ToInt32(MaritalStatus);
            }

            if (Gender != null)
            {
                ((Person_cu)ActiveDBItem).Gender = Convert.ToBoolean(Gender);
            }

            if (BirthDate != null)
            {
                ((Person_cu)ActiveDBItem).BirthDate = Convert.ToDateTime(BirthDate);
            }

            if (Mobile1 != null)
            {
                ((Person_cu)ActiveDBItem).Mobile1 = Mobile1.ToString();
            }

            if (Mobile2 != null)
            {
                ((Person_cu)ActiveDBItem).Mobile2 = Mobile2.ToString();
            }

            if (Phone1 != null)
            {
                ((Person_cu)ActiveDBItem).Phone1 = Phone1.ToString();
            }

            if (Phone2 != null)
            {
                ((Person_cu)ActiveDBItem).Phone2 = Phone2.ToString();
            }

            if (Address != null)
            {
                ((Person_cu)ActiveDBItem).Address = Address.ToString();
            }

            if (Email != null)
            {
                ((Person_cu)ActiveDBItem).EMail = Email.ToString();
            }

            if (IdentificationCardType != null)
            {
                ((Person_cu)ActiveDBItem).IdentificationCardType_P_ID = Convert.ToInt32(IdentificationCardType);
            }

            if (IdentificationCardNumber != null)
            {
                ((Person_cu)ActiveDBItem).IdentificationCardNumber = IdentificationCardNumber.ToString();
            }

            if (IdentificationCardIssueDate != null)
            {
                ((Person_cu)ActiveDBItem).IdentificationCardIssuingDate = Convert.ToDateTime(IdentificationCardIssueDate);
            }

            if (IdentificationCardExpirationDate != null)
            {
                ((Person_cu)ActiveDBItem).IdentificationCardExpirationDate = Convert.ToDateTime(IdentificationCardExpirationDate);
            }

            if (((Person_cu)ActiveDBItem).User_cu == null)
            {
                ((Person_cu)ActiveDBItem).User_cu = new User_cu();
            }

            if (InternalCode != null)
            {
                ((Person_cu)ActiveDBItem).User_cu.InternalCode = InternalCode.ToString();
            }

            if (LoginName != null)
            {
                ((Person_cu)ActiveDBItem).User_cu.LoginName = LoginName.ToString();
            }

            ((Person_cu)ActiveDBItem).User_cu.OragnizationID = (int)ApplicationStaticConfiguration.Organization;

            ((Person_cu)ActiveDBItem).User_cu.Password = Password.ToString();

            ((Person_cu)ActiveDBItem).IsOnDuty         = true;
            ((Person_cu)ActiveDBItem).User_cu.IsOnDuty = true;
            switch (((IUserViewer)ActiveCollector.ActiveViewer).CommonTransactionType)
            {
            case DB_CommonTransactionType.DeleteExisting:
                ((Person_cu)ActiveDBItem).IsOnDuty         = false;
                ((Person_cu)ActiveDBItem).User_cu.IsOnDuty = false;
                break;
            }

            RelatedViewers = ((IUserViewer)ActiveCollector.ActiveViewer).RelatedViewers;

            return(true);
        }