Exemple #1
0
 //入口
 public void UpdataIntensify(int index = 0, bool isIntensify = false)
 {
     if (isIntensify)
     {            //强化成功
         if (isStrengthen)
         {
             AlertWindowManager window = AlertWindowManager.GetInstance();
             window.AlertEquipWindow(GetEquipInfo(), 6, alertCallBack);
             ui.IntensifyBtn.isEnabled = false;
             isStrengthen = false;
         }
         else
         {
             Debug.Log("强化完成");
         }
     }
     clearAll();
     GetEquipFormRole();
     if (roleEquip.Count <= 0)
     {
         ui.Hide();
         return;
     }
     ShowItems();
     ui.ShowItems(roleEquip.Count);
     SetRoleEquipOnUI();
     ui.ClearAllItem();
     ShowSelectItemProperty(index, isIntensify);
 }
        private void DeleteEmployee()
        {
            try
            {
                EmployeeController.DeleteEmployee(EmployeeID, true);
                ClearEmployeeDetails();

                string script = "<script language='javascript'>function f(){radalert('Employee successfully deleted.', 330, 210); Sys.Application.remove_load(f);}; Sys.Application.add_load(f);</script>";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "radalert", script);
            }
            catch (Exception exception)
            {
                string exceptionMessage = exception.Message.Replace("\r\n", " ").Replace("\r", "").Replace("\n", "").Replace("'", "\"");
                AlertWindowManager.RadAlert("An error occurred while deleting the employee : " + exceptionMessage, 400, 200, "Error", "");
            }
        }
        private void SaveEmployee()
        {
            string validationError = "";

            if (!Validation(out validationError))
            {
                AlertWindowManager.RadAlert(validationError, 400, 200, "Error", "");
                return;
            }
            try
            {
                Employee employee = new Employee();
                employee.FirstName       = NameTextBox.Text;
                employee.LastName        = SurnameTextBox.Text;
                employee.Email           = EmailTextBox.Text;
                employee.CellNumber      = MobilemMaskedTextBox.Text;
                employee.LandLine        = LandlineMaskedTextBox.Text;
                employee.AddressLine1    = StreetTextBox.Text;
                employee.AddressLine2    = SuburbTextBox.Text;
                employee.PostalCode      = PostalCodeTextBox.Text;
                employee.InstagramHandle = InstagramTextBox.Text;
                employee.Facebook        = FacebookTextBox.Text;
                employee.TwitterHandle   = TwitterTextBox.Text;
                employee.LinkedIn        = LinkedInTextBox.Text;
                employee.Active          = true;

                if (EmployeeID > 0)
                {
                    employee.EmployeeID = EmployeeID;

                    EmployeeController.UpdateEmployee(employee);
                }
                else
                {
                    EmployeeID = EmployeeController.InsertEmployee(employee);
                }
                string script = "<script language='javascript'>function f(){radalert('Employee successfully saved.', 330, 210); Sys.Application.remove_load(f);}; Sys.Application.add_load(f);</script>";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "radalert", script);
            }
            catch (Exception exception)
            {
                string exceptionMessage = exception.Message.Replace("\r\n", " ").Replace("\r", "").Replace("\n", "").Replace("'", "\"");
                AlertWindowManager.RadAlert("An error occurred while saving the employee details : " + exceptionMessage, 400, 200, "Error", "");
            }
        }
 public AlertWindow()
 {
     _alertWindowManager = new AlertWindowManager();
     InitializeComponent();
     productsDataGrid.ItemsSource = _alertWindowManager.AddProductsInRows();
 }