/// <summary>
 /// We need this event since there are two constructors
 /// When the user clicks on 'New' button or presses Ins key
 /// nothing happens if we do not add the code below.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void gridView_NewItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
 {
     e.NewObject = new Provincia()
     {
         paisId = this.paisId
     };
 }
예제 #2
0
        // Remove from here!
        private void paisesGridView_NewItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
        {
            // No need for this
            //e.NewObject = new Pais();
            GridViewDataControl grid = e.OwnerGridViewItemsControl;

            grid.CurrentColumn = grid.Columns[0];
        }
예제 #3
0
        private void gridAd0_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
        {
            var employee = new Person();

            employee.Name      = "默认";
            employee.Age       = 20;
            employee.Birthdary = DateTime.Now;
            employee.IsAdmin   = false;
            e.NewObject        = employee;
        }
예제 #4
0
        void gvwRoom_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
        {
            Room newItem = new Room();

            newItem.RecordId     = _newId--;
            newItem.SiteId       = ucSitePicker.SiteId;
            newItem.RoomStatusId = (int)RoomStatus.Available;
            newItem.CreatedBy    = newItem.UpdatedBy = Globals.UserLogin.UserName;
            newItem.IsChanged    = true;
            e.NewObject          = newItem;
        }
예제 #5
0
        private void provinciasGridView_NewItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
        {
            ProvinciasViewModel viewModel = (ProvinciasViewModel)this.DataContext;

            // it should never happen!
            if (viewModel == null)
            {
                return;
            }

            e.NewObject = new Provincia()
            {
                paisId = viewModel.GetPaisId
            };
        }
        private async void gvClassRoomDetail_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
        {
            string strErrorMsg = string.Empty;

            if (_selectedCenter == null)
            {
                await DialogManager.ShowMessageAsync(this.GetMainWindow(), UIResources.MsgError, "请选择需要添加教室的中心", MessageDialogStyle.Affirmative, null);

                return;
            }
            try
            {
                EditClassroomWindow newClassroomWindow = new EditClassroomWindow();
                newClassroomWindow.ParentCenter = _selectedCenter;
                newClassroomWindow.Om           = OperationMode.AddMode;

                if (newClassroomWindow.ShowDialog() == true)
                {
                    await bindClassroom();
                }
            }
            catch (TimeoutException timeProblem)
            {
                strErrorMsg = timeProblem.Message + UIResources.TimeOut + timeProblem.Message;
            }
            catch (FaultException <LCFault> af)
            {
                strErrorMsg = af.Detail.Message;
            }
            catch (FaultException unknownFault)
            {
                strErrorMsg = UIResources.UnKnowFault + unknownFault.Message;
            }
            catch (CommunicationException commProblem)
            {
                strErrorMsg = UIResources.ConProblem + commProblem.Message + commProblem.StackTrace;
            }
            catch (Exception ex)
            {
                strErrorMsg = ex.Message;
                //AisinoMessageBox.Show(ex.Message, UIResources.MsgInfo, MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
            }
            if (strErrorMsg != string.Empty)
            {
                await DialogManager.ShowMessageAsync(this.GetMainWindow(), UIResources.MsgError, "添加教室信息失败!原因:" + strErrorMsg, MessageDialogStyle.Affirmative, null);
            }
        }
예제 #7
0
 private void gridDependent_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
 {
     try
     {
         var depen = new t_TempEmpDependents();
         depen.EmpID        = adminusers.Text;
         depen.Name         = depName;
         depen.BirthDate    = Convert.ToDateTime(depBirthDate);
         depen.Relationship = depRelationship;
         depen.Occupation   = depOccupation;
         depen.MaidenName   = depMaidenName;
         depen.LastUpdate   = DateTime.Now;
         e.NewObject        = depen;
         db.t_TempEmpDependents.Add(depen);
     }
     catch { }
 }
예제 #8
0
 private void gridWorkExp_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
 {
     try
     {
         var work = new t_EmpWorkExperience();
         work.EmpID          = EmpID.Text;
         work.CompanyName    = compName;
         work.CompanyAddress = compAddress;
         work.DateFrom       = Convert.ToDateTime(compFrom);;
         work.DateTo         = Convert.ToDateTime(compTo);;
         work.Position       = compPosition;
         work.LastUpdate     = DateTime.Now;
         e.NewObject         = work;
         db.t_EmpWorkExperience.Add(work);
     }
     catch { }
 }
예제 #9
0
        private void gridSection_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
        {
            try
            {
                var sect = new t_DepartmentalSection();
                sect.SectCode = sectcode;
                sect.SectName = sectname;
                sect.DeptCode = Department.SelectedValue.ToString();
                e.NewObject   = sect;

                db.t_DepartmentalSection.Add(sect);
            }
            catch
            {
                MessageBox.Show("Select Department");
                Department.ItemsSource = db.t_Department.ToList();
            }
        }
예제 #10
0
        private void gridPosition_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
        {
            try
            {
                var dept = new t_Position();
                dept.Code        = code;
                dept.Description = desc;
                dept.DeptCode    = Department.SelectedValue.ToString();
                e.NewObject      = dept;

                db.t_Position.Add(dept);
            }
            catch
            {
                MessageBox.Show("Select Department");
                Department.ItemsSource = db.t_Department.ToList();
            }
        }
예제 #11
0
 private void gridView_NewItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
 {
 }
예제 #12
0
 private void DataGrid_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
 {
     CurrentColumn         = NameColumn;
     NameColumn.IsReadOnly = false;
 }
 private void attachmentDataGrid_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
 {
     //attachmentDataForm.AddNewItem();
 }
예제 #14
0
 private void DataGrid_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
 {
 }