예제 #1
0
 private void CreateJobKeyList(string[,] keylist, bool isreset)
 {
     SystemEnvironment environment = SystemEnvironment.CreateInstance();
     for (int i = 0; i < keylist.GetLength(0); i++)
     {
         bool flag = false;
         string str = keylist[i, 0];
         if (str == null)
         {
             goto Label_007E;
         }
         if (!(str == "B"))
         {
             if (str == "I")
             {
                 goto Label_005A;
             }
             if (str == "M")
             {
                 goto Label_006C;
             }
             goto Label_007E;
         }
         if (environment.TerminalInfo.UserKind == 2)
         {
             flag = true;
         }
         goto Label_0080;
     Label_005A:
         if (environment.TerminalInfo.Protocol != ProtocolType.Mail)
         {
             flag = true;
         }
         goto Label_0080;
     Label_006C:
         if (environment.TerminalInfo.Protocol == ProtocolType.Mail)
         {
             flag = true;
         }
         goto Label_0080;
     Label_007E:
         flag = true;
     Label_0080:
         if (flag)
         {
             KeyClass item = new KeyClass {
                 Name = keylist[i, 1],
                 NameKJ = keylist[i, 2]
             };
             if (isreset)
             {
                 item.Sckey = "";
             }
             else
             {
                 item.Sckey = keylist[i, 3];
             }
             this.KeyInfoList.KeyList.Add(item);
         }
     }
 }
예제 #2
0
 private void SaveUserKey()
 {
     KeyClass class3;
     JobKeyClass item = new JobKeyClass();
     userKey.JobKeyList.Clear();
     foreach (DataGridViewRow row in (IEnumerable) this.dgvUserKeyJ.Rows)
     {
         class3 = new KeyClass();
         if (string.IsNullOrEmpty(row.Cells[this.cKJWindowCode.Index].Value.ToString()))
         {
             row.Cells[this.cKJName.Index].Value = row.Cells[this.cKJGymCode.Index].Value.ToString();
         }
         else
         {
             row.Cells[this.cKJName.Index].Value = row.Cells[this.cKJGymCode.Index].Value.ToString() + "." + row.Cells[this.cKJWindowCode.Index].Value.ToString();
         }
         if (!string.IsNullOrEmpty(row.Cells[this.cKJName.Index].Value.ToString()))
         {
             class3.Name = row.Cells[this.cKJName.Index].Value.ToString();
             if ((row.Cells[this.cKJSckey.Index].Value.ToString() != "-") && (row.Cells[this.cKJSckey.Index].Value.ToString() != ""))
             {
                 class3.Sckey = row.Cells[this.cKJSckey.Index].Value.ToString();
             }
             else
             {
                 class3.Sckey = "";
             }
             item.KeyList.Add(class3);
         }
     }
     item.Kind = 0;
     userKey.JobKeyList.Add(item);
     for (int i = 1; i < 4; i++)
     {
         item = new JobKeyClass();
         foreach (DataRow row2 in this.dtsUserKey.Tables[i].Rows)
         {
             class3 = new KeyClass();
             if (!string.IsNullOrEmpty(row2.ItemArray[2].ToString()))
             {
                 class3.Name = row2.ItemArray[2].ToString();
                 class3.NameKJ = row2.ItemArray[0].ToString();
                 if ((row2.ItemArray[1].ToString() != "-") && (row2.ItemArray[1].ToString() != ""))
                 {
                     class3.Sckey = row2.ItemArray[1].ToString();
                 }
                 else
                 {
                     class3.Sckey = "";
                 }
                 item.KeyList.Add(class3);
             }
         }
         item.Kind = i;
         userKey.JobKeyList.Add(item);
     }
 }