示例#1
0
        private void btnSave_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            try
            {
                //CallingList Name Validation
                if (txtName.Text.Trim() == "")
                {
                    System.Windows.MessageBox.Show("CallingList Name can't be left blank", "-> Please Enter a Name", MessageBoxButton.OK, MessageBoxImage.Information);
                    txtName.Focus();
                    txtName.Text = txtName.Text.Trim();
                    return;
                }

                ClsCallingList c = new ClsCallingList();
                if (varState == 0)
                {
                    c.ID = -1;
                }
                else
                {
                    c.ID = varID;
                }
                c.ListName  = txtName.Text.TrimEnd(' ').TrimStart(' ');
                c.IsActive  = (bool)chkIsActive.IsChecked;
                c.IsDNCList = (bool)chkIsDNCList.IsChecked;
                c.CreatedBy = VMuktiAPI.VMuktiInfo.CurrentPeer.ID;
                Int64 gID = c.Save();

                if (gID == 0)
                {
                    System.Windows.MessageBox.Show("Duplicate List Name Is Not Allowed !!", "-> Calling List", MessageBoxButton.OK, MessageBoxImage.Information);
                }
                else
                {
                    System.Windows.MessageBox.Show("Record Saved Successfully!!");
                    funSetGrid();
                    FncClearAll();
                }
            }

            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "btnSave_Click", "ctlCalllingList.xaml.cs");
            }
        }
示例#2
0
        void CtlGrid_btnDeleteClicked(int rowID)
        {
            try
            {
                varID = Convert.ToInt64(objCallCollection[rowID].ID);
                MessageBoxResult r = System.Windows.MessageBox.Show("Do You Really Want To Delete This Record ?", "->Delete Calling List", MessageBoxButton.YesNo, MessageBoxImage.Question);
                if (r == MessageBoxResult.Yes)
                {
                    ClsCallingList.Delete(varID);
                    System.Windows.MessageBox.Show("Record Deleted!!", "->Calling List", MessageBoxButton.OK, MessageBoxImage.Information);
                    funSetGrid();
                }

                FncClearAll();
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "CtlGrid_btnDeleteClicked", "ctlCalllingList.xaml.cs");
            }
        }