private void SetDefaultUserKey(bool isreset) { JobKeyClass item = new JobKeyClass { Kind = 0 }; this.jobKeyList.Add(item); for (int i = 1; i < 4; i++) { KeyListClass class3 = new KeyListClass(); item = new JobKeyClass(); class3.GetJobKeyList(i, isreset); item.KeyList = class3.KeyInfoList.KeyList; item.Kind = i; this.jobKeyList.Add(item); } }
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); } }