Esempio n. 1
0
 private void VolumeGrid_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex < 0)
     return;
       Navigator.GoDevicePos(this.ActiveHolder, int.Parse(this.VolumeGrid[0, e.RowIndex].Value.ToString()));
       Navigator.ActiveVolumePos = e.RowIndex + 1;
       if (!this.ExchangeFlag)
     return;
       Navigator.VolumeDisc VolumeDisc1 = new Navigator.VolumeDisc();
       VolumeDisc1.HolderPS = Navigator.ActiveVolumePos;
       VolumeDisc1.DeviceID = Navigator.HolderArray[this.ActiveHolder].DeviceID;
       ArrayList[] dbVolumeList1 = Navigator.GetDBVolumeList("ID", "DeviceID=" + (object) VolumeDisc1.DeviceID + " and HolderPS=" + (object) VolumeDisc1.HolderPS);
       if (dbVolumeList1[0].Count > 0)
       {
     VolumeDisc1.ID = int.Parse(dbVolumeList1[0][0].ToString());
     VolumeDisc1.Drive = dbVolumeList1[1][0].ToString();
     VolumeDisc1.Label = dbVolumeList1[2][0].ToString();
     VolumeDisc1.RegDate = dbVolumeList1[5][0].ToString();
       }
       else
       {
     VolumeDisc1.ID = 0;
     VolumeDisc1.Drive = "";
     VolumeDisc1.Label = Navigator.EMPTY_VOLUME;
     VolumeDisc1.RegDate = "";
       }
       Navigator.VolumeDisc VolumeDisc2 = new Navigator.VolumeDisc();
       VolumeDisc2.HolderPS = this.ExchangePos;
       VolumeDisc2.DeviceID = Navigator.HolderArray[this.ExchangeHolder].DeviceID;
       ArrayList[] dbVolumeList2 = Navigator.GetDBVolumeList("ID", "DeviceID=" + (object) VolumeDisc2.DeviceID + " and HolderPS=" + (object) VolumeDisc2.HolderPS);
       if (dbVolumeList2[0].Count > 0)
       {
     VolumeDisc2.ID = int.Parse(dbVolumeList2[0][0].ToString());
     VolumeDisc2.Drive = dbVolumeList2[1][0].ToString();
     VolumeDisc2.Label = dbVolumeList2[2][0].ToString();
     VolumeDisc2.RegDate = dbVolumeList2[5][0].ToString();
       }
       else
       {
     VolumeDisc2.ID = 0;
     VolumeDisc2.Drive = "";
     VolumeDisc2.Label = Navigator.EMPTY_VOLUME;
     VolumeDisc2.RegDate = "";
       }
       Navigator.VolumeDisc volumeDisc1 = new Navigator.VolumeDisc();
       Navigator.VolumeDisc volumeDisc2 = new Navigator.VolumeDisc();
       Navigator.VolumeDisc volumeDisc3 = VolumeDisc1;
       Navigator.VolumeDisc volumeDisc4 = VolumeDisc2;
       VolumeDisc1.DeviceID = volumeDisc4.DeviceID;
       VolumeDisc1.HolderPS = volumeDisc4.HolderPS;
       VolumeDisc2.DeviceID = volumeDisc3.DeviceID;
       VolumeDisc2.HolderPS = volumeDisc3.HolderPS;
       if (VolumeDisc1.Label.Equals(Navigator.EMPTY_VOLUME))
     this.DeleteVolume(this.ActiveHolder, volumeDisc3.HolderPS);
       if (VolumeDisc2.Label.Equals(Navigator.EMPTY_VOLUME))
     this.DeleteVolume(this.ExchangeHolder, volumeDisc4.HolderPS);
       if (!VolumeDisc2.Label.Equals(Navigator.EMPTY_VOLUME))
     Navigator.EditVolume(VolumeDisc2);
       if (!VolumeDisc1.Label.Equals(Navigator.EMPTY_VOLUME))
     Navigator.EditVolume(VolumeDisc1);
       Navigator.RefreshVolumeList(this.ActiveHolder, ref this.VolumeGrid);
       this.ExchangePos = -1;
       this.ExchangeHolder = -1;
       this.ExchangeFlag = false;
       this.Animation(false);
 }
Esempio n. 2
0
 public static Navigator.VolumeDisc BuildVolume(ArrayList[] VolumeList_Temp)
 {
     Navigator.VolumeDisc volumeDisc = new Navigator.VolumeDisc();
       if (VolumeList_Temp[0].Count > 0)
       {
     volumeDisc.ID = int.Parse(VolumeList_Temp[0][0].ToString());
     volumeDisc.Drive = VolumeList_Temp[1][0].ToString();
     volumeDisc.Label = VolumeList_Temp[2][0].ToString();
     volumeDisc.DeviceID = int.Parse(VolumeList_Temp[3][0].ToString());
     volumeDisc.HolderPS = int.Parse(VolumeList_Temp[4][0].ToString());
     volumeDisc.RegDate = VolumeList_Temp[5][0].ToString();
       }
       return volumeDisc;
 }
Esempio n. 3
0
 public void ReadVolume(string ComboDrive, int HolderNumber, int HolderPS)
 {
     if (!ComboDrive.Equals(Navigator.NoDrive) && !this.CheckIfExistsDrive(ComboDrive))
     return;
       ArrayList arrayList = new ArrayList();
       DirectoryInfo directoryInfo = new DirectoryInfo(ComboDrive.Substring(0, 2) + "\\");
       Navigator.VolumeDisc VolumeDisc = new Navigator.VolumeDisc();
       VolumeDisc.DeviceID = Navigator.HolderArray[HolderNumber].DeviceID;
       VolumeDisc.HolderPS = HolderPS;
       if (!this.CheckFreePosition(HolderNumber, HolderPS))
       {
     if (!Navigator.AskYesNo(this.Strx[16].ToString() + " " + Navigator.GetVolume_By_HolderPS(HolderNumber, HolderPS).Label + "? "))
       return;
     this.DeleteVolume(HolderNumber, HolderPS);
       }
       VolumeDisc.ID = this.GetFreeVolumeID();
       if (!ComboDrive.Equals(Navigator.NoDrive))
       {
     VolumeDisc.Drive = directoryInfo.FullName.Substring(0, 2);
     DriveInfo driveInfo = new DriveInfo(VolumeDisc.Drive);
     int num = driveInfo.VolumeLabel == null ? 0 : (!driveInfo.VolumeLabel.Equals("") ? 1 : 0);
     VolumeDisc.Label = num != 0 ? driveInfo.VolumeLabel : driveInfo.Name;
       }
       else
       {
     VolumeDisc.Drive = "X:\\";
     VolumeDisc.Label = "New Volume";
       }
       if (this.CheckIfExistsVolume(HolderNumber, VolumeDisc.Label))
       {
     string Label = VolumeDisc.Label;
     bool flag = false;
     while (this.CheckIfExistsVolume(HolderNumber, Label) && !flag)
     {
       string str;
       Label = Navigator.AskString(Label + " " + this.Strx[17].ToString(), str = Label + "#", 16, false);
       if (Navigator.Asking_Form.Answer.Equals("<no>"))
       {
     if (!Navigator.AskYesNo(VolumeDisc.Label + " " + this.Strx[18].ToString()))
       return;
     int volumePosByVolumeName = Navigator.GetVolumePos_By_VolumeName(HolderNumber, VolumeDisc.Label);
     this.DeleteVolume(HolderNumber, volumePosByVolumeName);
     flag = true;
       }
       else
       {
     VolumeDisc.Label = Navigator.Asking_Form.Answer;
     flag = true;
       }
     }
       }
       DateTime now = DateTime.Now;
       string str1 = now.Date.ToString().Substring(0, 10);
       string str2 = Services.NormalizedTime(now.TimeOfDay.ToString()).Substring(0, 5);
       VolumeDisc.RegDate = str1 + " " + str2;
       Navigator.EditVolume(VolumeDisc);
       if (!ComboDrive.Equals(Navigator.NoDrive))
       {
     Navigator.LocGetFileSubFolders(VolumeDisc.ID, this.ComboDrives.Text.Substring(0, 3), "*.*");
     if (Navigator.Progress_Form.abortFlag)
       this.DeleteVolume(HolderNumber, HolderPS);
       }
       Navigator.RefreshVolumeList(this.ComboHolder.SelectedIndex, ref this.VolumeGrid);
 }