Exemplo n.º 1
0
 private void GetUserNamesAndSetToUserNameTxtBox_AutoComplete()
 {
     try
     {
         using (DataTable dtUserNames = UserMasterDAL.GetAllUsersInformation())
         {
             if (dtUserNames != null)
             {
                 if (dtUserNames.Rows.Count > 0)
                 {
                     AutoCompleteStringCollection usrNameColl = new AutoCompleteStringCollection();
                     for (int i = 0; i < dtUserNames.Rows.Count; i++)
                     {
                         if (dtUserNames.Rows[i]["USER_NAME"] != null)
                         {
                             usrNameColl.Add(dtUserNames.Rows[i]["USER_NAME"].ToString());
                         }
                     }
                     txtUserName.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
                     txtUserName.AutoCompleteSource       = AutoCompleteSource.CustomSource;
                     txtUserName.AutoCompleteCustomSource = usrNameColl;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         ErrorHandling.WriteErrorLog(ex.Message);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Fill Roles drop down.
 /// </summary>
 private void FillRolesDropDownList()
 {
     try
     {
         DataTable dtRoles = UserMasterDAL.GetRoles();
         if (dtRoles != null)
         {
             if (dtRoles.Rows.Count > 0)
             {
                 cmbRole.DataSource    = dtRoles;
                 cmbRole.DisplayMember = "ROLE_NAME";
                 cmbRole.ValueMember   = "ROLE_ID";
             }
         }
     }
     catch (Exception ex)
     {
         ErrorHandling.WriteErrorLog(ex.ToString());
     }
 }
Exemplo n.º 3
0
        public List <GroupUser> GetAllUser(/*, int VesselID*/)
        {
            UserMasterDAL dAL = new UserMasterDAL();

            return(dAL.GetAllUser(/*, VesselID*/));
        }
Exemplo n.º 4
0
        public List <UserMasterPOCO> GetAllUserForDropDown()
        {
            UserMasterDAL shipDal = new UserMasterDAL();

            return(shipDal.GetAllUserListForDropDown());
        }
Exemplo n.º 5
0
        public int AllowSignatureUpload(int UserId)
        {
            UserMasterDAL dAL = new UserMasterDAL();

            return(dAL.AllowSignatureUpload(UserId));
        }
Exemplo n.º 6
0
        public int UploadPermissionUserMaster(int UserId /*, ref string oUTPUT*/)
        {
            UserMasterDAL dAL = new UserMasterDAL();

            return(dAL.UploadPermissionUserMaster(UserId /*, ref oUTPUT*/));
        }
Exemplo n.º 7
0
        public int DeleteUserMaster(int UserId /*, ref string oUTPUT*/)
        {
            UserMasterDAL dAL = new UserMasterDAL();

            return(dAL.DeleteUserMaster(UserId /*, ref oUTPUT*/));
        }
Exemplo n.º 8
0
        public List <UserMasterPOCO> GetUserByEmailId(string Email /*, int VesselID*/)
        {
            UserMasterDAL dAL = new UserMasterDAL();

            return(dAL.GetUserByEmailId(Email /*, VesselID*/));
        }
 public User spCheckUserMasterByID(String UserName, String Password)
 {
     return(UserMasterDAL.spCheckUserMasterByID(UserName, Password));
 }
 public DataTable GetUserMasterByID(int UserID)
 {
     //return UserMasterDAL.GetUserMasterByID(UserID);
     return(UserMasterDAL.spGetUserMasterByID(UserID));
 }
 public void DeleteUserMaster(int UserID)
 {
     //UserMasterDAL.DeleteUserMaster(UserID);
     UserMasterDAL.spDeleteUserMaster(UserID);
 }
 public void UpdateUserMaster(int UserID, String UserName, String Password, String Status)
 {
     //UserMasterDAL.UpdateUserMaster(UserID ,UserName , Password, Status);
     UserMasterDAL.spUpdateUserMaster(UserID, UserName, Password, Status);
 }
 public void AddUserMaster(String UserName, String Password, String Status)
 {
     //UserMasterDAL.AddUserMaster( UserName, Password, Status);
     UserMasterDAL.spAddUserMaster(UserName, Password, Status);
 }
 public DataTable GetUserMaster()
 {
     //return UserMasterDAL.GetUserMaster();
     return(UserMasterDAL.spGetUserMaster());
 }
Exemplo n.º 15
0
        public UserMasterPOCO GetUserByUserId(int UserId /*, int VesselID*/)
        {
            UserMasterDAL dAL = new UserMasterDAL();

            return(dAL.GetUserByUserId(UserId /*, VesselID*/));
        }
Exemplo n.º 16
0
        public List <UserMasterPOCO> GetUserByIMO(string VesselIMO /*, int VesselID*/)
        {
            UserMasterDAL dAL = new UserMasterDAL();

            return(dAL.GetUserByIMO(VesselIMO /*, VesselID*/));
        }
Exemplo n.º 17
0
        //for Ship drp
        public List <UserMasterPOCO> GetAllShipForDrp(/*int VesselID*/)
        {
            UserMasterDAL dAL = new UserMasterDAL();

            return(dAL.GetAllShipForDrp(/*VesselID*/));
        }
Exemplo n.º 18
0
        public List <UserMasterPOCO> GetUserByRank(int RankId /*, int VesselID*/)
        {
            UserMasterDAL dAL = new UserMasterDAL();

            return(dAL.GetUserByRank(RankId /*, VesselID*/));
        }
Exemplo n.º 19
0
        public string GetRoleByUserId(int UserId /*, ref string oUTPUT*/)
        {
            UserMasterDAL dAL = new UserMasterDAL();

            return(dAL.GetRoleByUserId(UserId /*, ref oUTPUT*/));
        }
Exemplo n.º 20
0
        public int ApprovedRoNotInUserMaster(int UserId /*, ref string oUTPUT*/)
        {
            UserMasterDAL dAL = new UserMasterDAL();

            return(dAL.ApprovedRoNotInUserMaster(UserId /*, ref oUTPUT*/));
        }
Exemplo n.º 21
0
        /// <summary>
        /// Added on 13th Jul 2021 @BK
        /// </summary>
        /// <param name="pOCO"></param>
        /// <returns></returns>
        public int ChangePassword(UserMasterPOCO aUserMaster)
        {
            UserMasterDAL umDAL = new UserMasterDAL();

            return(umDAL.ChangePassword(aUserMaster));
        }
Exemplo n.º 22
0
        public string GenerateUserCode(string asUserType, string asShipId, string asRankId, string asUserName)
        {
            UserMasterDAL userDal = new UserMasterDAL();

            return(userDal.GenerateUserCode(asUserType, asShipId, asRankId, asUserName));
        }
Exemplo n.º 23
0
        public int ForgotPassword(UserMasterPOCO pOCO, ref string initialPwd, ref string userCode)
        {
            UserMasterDAL umDAL = new UserMasterDAL();

            return(umDAL.ForgotPassword(pOCO, ref initialPwd, ref userCode));
        }
Exemplo n.º 24
0
        public int SaveUpdateUser(UserMasterPOCO pOCO /*,int VesselID*/)
        {
            UserMasterDAL dAL = new UserMasterDAL();

            return(dAL.SaveUpdateUser(pOCO /*, VesselID*/));
        }
Exemplo n.º 25
0
        public List <UserMasterPOCO> GetAllUserPageWise(int pageIndex, ref int recordCount, int length, int UserType, int shipId)
        {
            UserMasterDAL dAL = new UserMasterDAL();

            return(dAL.GetAllUserPageWise(pageIndex, ref recordCount, length, UserType, shipId));
        }
Exemplo n.º 26
0
        public List <UserMasterPOCO> GetAllUserByShipForDropDown(int shipId)
        {
            UserMasterDAL shipDal = new UserMasterDAL();

            return(shipDal.GetAllUserListByShipForDropDown(shipId));
        }
Exemplo n.º 27
0
        /// <summary>
        /// Validate LDAP user & give access to appplication.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLogin_Click(object sender, EventArgs e)
        {
            try
            {
                string strErrMsg = "";
                if (ValidateUserInputs(out strErrMsg))
                {
                    //bool blStatus = ChemistryOperations.MoleculeComparisonTest("", "");

                    //Get User Details
                    DataTable dtUserDetails = UserMasterDAL.GetUserDetailsByUserNameAndRoleId(txtUserName.Text.Trim(), Convert.ToInt32(cmbRole.SelectedValue), cmbModule.Text);
                    if (dtUserDetails != null && dtUserDetails.Rows.Count > 0)
                    {
                        char isLDAPUser = Convert.ToChar(dtUserDetails.Rows[0]["IS_LDAP_USER"]);
                        if (isLDAPUser == 'N')
                        {
                            DataTable dtUserCredentilas = UserMasterDAL.GetUserCredentialsByUserNameAndPassword(txtUserName.Text.Trim(), txtPassword.Text.Trim());
                            if (dtUserCredentilas != null && dtUserCredentilas.Rows.Count > 0)
                            {
                                //Filling Data into Global variables.
                                GlobalVariables.UserName       = txtUserName.Text.Trim();
                                GlobalVariables.RoleName       = cmbRole.Text;
                                GlobalVariables.Module         = cmbModule.Text;
                                GlobalVariables.RoleId         = Convert.ToInt32(cmbRole.SelectedValue);
                                GlobalVariables.UserID         = Convert.ToInt32(dtUserDetails.Rows[0]["USER_ID"].ToString());
                                GlobalVariables.UR_ID          = Convert.ToInt32(dtUserDetails.Rows[0]["UR_ID"].ToString());
                                GlobalVariables.IsLoginSuccess = true;

                                DialogResult = DialogResult.OK;
                                this.Close();
                            }
                            else
                            {
                                MessageBox.Show("Invalid User Name / Password", GlobalVariables.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            }
                        }
                        else
                        {
                            // LDAP user exists or not
                            if (ValidateUserAgainstLDAP())
                            {
                                //Filling Data into Global variables.
                                GlobalVariables.UserName       = txtUserName.Text.Trim();
                                GlobalVariables.RoleName       = cmbRole.Text;
                                GlobalVariables.Module         = cmbModule.Text;
                                GlobalVariables.RoleId         = Convert.ToInt32(cmbRole.SelectedValue);
                                GlobalVariables.UserID         = Convert.ToInt32(dtUserDetails.Rows[0]["USER_ID"].ToString());
                                GlobalVariables.UR_ID          = Convert.ToInt32(dtUserDetails.Rows[0]["UR_ID"].ToString());
                                GlobalVariables.IsLoginSuccess = true;

                                DialogResult = DialogResult.OK;
                                this.Close();
                            }
                            else
                            {
                                MessageBox.Show("Invalid User Name / Password", GlobalVariables.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            }//End LDAP.
                        }
                    }
                    else
                    {
                        MessageBox.Show("Invalid User Name / Password / Role", GlobalVariables.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show(strErrMsg, GlobalVariables.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                ErrorHandling.WriteErrorLog(ex.ToString());
            }
        }