Exemple #1
0
        public void Edit_Click(object obj)
        {
            try
            {
                CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgStart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));

                if (obj != null)
                {
                    WebPortalUserList objSelectedUser = (WebPortalUserList)obj;
                    if (objSelectedUser != null)
                    {
                        UserInfoEnabled = true;
                        IsModify        = true;
                        IsButtonPanel   = Resources.MsgVisible;
                        IsAction        = Resources.ActionUpdate;
                        IsVisibleInfo   = Resources.MsgVisible;
                        UserID          = objSelectedUser.userID;
                        UserName        = objSelectedUser.username;
                        Password        = objSelectedUser.password;
                        Email           = objSelectedUser.email;
                        Phone           = objSelectedUser.phone;
                        IsActive        = (int)objSelectedUser.isActive;
                        FirstName       = objSelectedUser.firstname;
                        LastName        = objSelectedUser.lastname;
                        LastLogin       = objSelectedUser.lastLogin;
                        if (UserID > 0)
                        {
                            listCustomer = null;
                            ListModule   = null;
                            ListRole     = null;
                            ListGroup    = null;
                            FillModules((int)UserID);
                            FillCustomers((int)UserID);
                            FillRoles((int)userID);
                            FillGroups((int)(UserID));
                        }
                        AcceptChanges();
                    }
                    CurrentView = new WebPortalUserDetailsView();
                }
            }
            catch (Exception ex)
            {
                CommonSettings.logger.LogError(this.GetType(), ex);
            }
            finally
            {
                CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgEnd, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
            }
        }
Exemple #2
0
 /// <summary>
 /// Function to create a new customer.
 /// </summary>
 /// <param name="obj"></param>
 /// <returns>NA</returns>
 /// <createdBy></createdBy>
 /// <createdOn>May-27,2016</createdOn>
 public void New_Click(object obj)
 {
     try
     {
         CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgStart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
         UserInfoEnabled = true;
         IsModify        = false;
         IsButtonPanel   = Resources.MsgVisible;
         IsAction        = Resources.ActionSave;
         IsVisibleInfo   = Resources.MsgVisible;
         if (ListCustomer == null)
         {
             FillCustomers(0);
         }
         if (ListModule == null)
         {
             FillModules(0);
         }
         if (ListRole == null)
         {
             FillRoles(0);
         }
         if (ListGroup == null)
         {
             FillGroups(0);
         }
         ClearUserInfo();
         CurrentView = new WebPortalUserDetailsView();
         AcceptChanges();
     }
     catch (Exception ex)
     {
         CommonSettings.logger.LogError(this.GetType(), ex);
     }
     finally
     {
         CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgEnd, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
     }
 }