예제 #1
0
 public static ClsDisposition GetByDispositionListID(Int64 ID)
 {
     try
     {
         ClsDisposition obj = new ClsDisposition();
         DataSet        ds  = new DispositionList.DataAccess.ClsDispositionDataService().Disposition_GetByDispositionListID(ID);
         if (!obj.MapData(ds))
         {
             obj = null;
         }
         return(obj);
     }
     catch (Exception ex)
     {
         VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "GetByDispositionListID()", "ClsDisposition.cs");
         return(null);
     }
 }
        private void btnSave_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            try
            {
                if (txtName.Text.Trim() == "")
                {
                    System.Windows.MessageBox.Show("DispositionList Name cannot be left Blank", "-> Please Enter a Name", MessageBoxButton.OK, MessageBoxImage.Information);
                    txtName.Focus();
                    txtName.Text = txtName.Text.Trim();
                    return;
                }

                string strDispositions = "";

                for (int i = 0; i < lstSelectedDispositions.Items.Count; i++)
                {
                    if (i == 0)
                        strDispositions = ((ListBoxItem)lstSelectedDispositions.Items[i]).Tag.ToString();
                    else
                        strDispositions = strDispositions + "," + ((ListBoxItem)lstSelectedDispositions.Items[i]).Tag.ToString();
                }
                ClsDispositionList c = new ClsDispositionList();
                if (varState == 0)
                {
                    c.ID = -1;
                }
                else
                {
                    c.ID = varID;

                }
                c.DispositionListName = txtName.Text.Trim();
                c.Description = txtDescription.Text.Trim();
                c.IsActive = (bool)chkIsActive.IsChecked;
                c.CreatedBy = VMuktiAPI.VMuktiInfo.CurrentPeer.ID;
                Int64 gID = c.Save();

                if (gID == 0)
                {
                    System.Windows.MessageBox.Show("Duplicate Entry For DispositionList Is Not Allowed !!", "-> Disposition List", MessageBoxButton.OK, MessageBoxImage.Information);
                }

                else
                {
                    if (varState != 0)
                    {
                        ClsDisposition u1 = new ClsDisposition();
                        u1.ID = gID;
                        u1.Delete();
                    }

                    for (int i = 0; i < lstSelectedDispositions.Items.Count; i++)
                    {
                        ClsDisposition u = new ClsDisposition();
                        u.ID = int.Parse(((ListBoxItem)lstSelectedDispositions.Items[i]).Tag.ToString());
                        u.DispositionListId = gID;
                        u.Save();
                    }

                    System.Windows.MessageBox.Show("Record Saved Successfully!!", "-> Disposition List", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                    FnClearAll();

                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "btnSave_Click()", "CtlDispositionList.cs");                            
            }
        }
예제 #3
0
 public static ClsDisposition GetByDispositionListID(Int64 ID)
 {
     try
     {
         ClsDisposition obj = new ClsDisposition();
         DataSet ds = new DispositionList.DataAccess.ClsDispositionDataService().Disposition_GetByDispositionListID(ID);
         if (!obj.MapData(ds)) obj = null;
         return obj;
     }
     catch (Exception ex)
     {
         VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "GetByDispositionListID()", "ClsDisposition.cs");
         return null;
     } 
     
 }