Esempio n. 1
0
 private void ExpandButton_b_Click(object sender, EventArgs e)
 {
     try
     {
         using (GMAccountDBDataContext gmaccountDBDataContext = new GMAccountDBDataContext())
         {
             IQueryable <GMAccounts> source = from line in gmaccountDBDataContext.GMAccounts
                                              where line.ID == WindowsIdentity.GetCurrent().Name.ToString()
                                              select line;
             if (source.Count <GMAccounts>() == 0)
             {
                 MessageBox.Show("접근 권한이 없습니다!", "에러", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             }
             else
             {
                 base.Height = (this.formHeight = 569);
                 this.NotifyButton.Visible        = (this.NotifyTextBox.Visible = true);
                 this.ClientCommandButton.Visible = (this.ConsoleCommandTextBox.Visible = true);
                 this.ShurinkButton_a.Visible     = (this.ExpandButton_a.Visible = false);
                 this.ShurinkButton_b.Visible     = (this.ExpandButton_b.Visible = false);
                 this.ShurinkButton_c.Visible     = (this.ExpandButton_c.Visible = true);
             }
         }
     }
     catch
     {
         MessageBox.Show("DB 접근에 실패했습니다!", "에러", MessageBoxButtons.OK, MessageBoxIcon.Hand);
     }
 }
Esempio n. 2
0
        private void ExtendExpireTimeButton_Click(object sender, EventArgs e)
        {
            base.Enabled = false;
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendLine(string.Format("{0} 부터 {1} 분 연장", DateTime.Now, this.CashExtendMinutesUpDown1.Value));
            stringBuilder.AppendLine("---");
            stringBuilder.AppendLine("연장 작업은 대단히 오래 걸릴 수 있습니다. 중간에 프로그램을 끄지 마세요.");
            stringBuilder.AppendLine("캐시 아이템 연장 명령을 실행할까요?");
            DialogResult dialogResult = MessageBox.Show(stringBuilder.ToString(), "캐시 아이템 연장", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

            if (dialogResult == DialogResult.OK && this.CashExtendMinutesUpDown1.Value > 0m)
            {
                using (GMAccountDBDataContext gmaccountDBDataContext = new GMAccountDBDataContext())
                {
                    gmaccountDBDataContext.ExtendCashItems(new DateTime?(DateTime.UtcNow), new int?((int)this.CashExtendMinutesUpDown1.Value));
                }
            }
            base.Enabled = true;
        }