Exemple #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void kyakka_Click(object sender, EventArgs e)
        {
            int upCount = 0;

            for (int i = 0; i < shinseiDataGridView1.Rows.Count; i++)
            {
                if (shinseiDataGridView1.Rows[i].Cells[0].Value == null
                    || (bool)shinseiDataGridView1.Rows[i].Cells[0].Value == false)
                {
                    continue;
                }
                using (var context = new MyContext())
                {
                    long condtion = Convert.ToInt64(this.shinseiDataGridView1.Rows[i].Cells["SHINSEI_ID"].Value.ToString());
                    var w = context.WordShinsei.Single(x => x.SHINSEI_ID == condtion);
                    w.CRE_DATE = System.DateTime.Now.ToString();
                    w.STATUS = 2;
                    context.SaveChanges();
                }
                upCount++;
            }
            if (upCount == 0)
            {
                MessageBox.Show(MessageConst.ERR_004);
                return;
            }
            MessageBox.Show(MessageConst.CONF_003);
            this.Shinsei_Load(sender, e);
        }
Exemple #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void shounin_Click(object sender, EventArgs e)
        {
            int upCount = 0;

            for (int i = 0; i < shinseiDataGridView1.Rows.Count; i++)
            {
                if (shinseiDataGridView1.Rows[i].Cells[0].Value == null
                    || (bool)shinseiDataGridView1.Rows[i].Cells[0].Value == false)
                {
                    continue;
                }

                using (var context = new MyContext())
                {
                    long condtion = Convert.ToInt64(this.shinseiDataGridView1.Rows[i].Cells["SHINSEI_ID"].Value.ToString());

                    var w = context.WordShinsei.Single(x => x.SHINSEI_ID == condtion);
                    w.CRE_DATE = System.DateTime.Now.ToString();
                    w.STATUS = 1;

                    WordDic word = new WordDic();
                    word.RONRI_NAME1 = Convert.ToString(this.shinseiDataGridView1.Rows[i].Cells["RONRI_NAME1"].Value);
                    word.RONRI_NAME2 = Convert.ToString(this.shinseiDataGridView1.Rows[i].Cells["RONRI_NAME2"].Value);
                    word.BUTSURI_NAME = Convert.ToString(this.shinseiDataGridView1.Rows[i].Cells["BUTSURI_NAME"].Value);
                    word.USER_ID = BaseForm.UserInfo.userId;
                    word.CRE_DATE = System.DateTime.Now.ToString();
                    context.WordDic.Add(word);

                    context.SaveChanges();

                    upCount++;
                }
            }
            if (upCount == 0)
            {
                MessageBox.Show(MessageConst.ERR_004);
                return;
            }
            MessageBox.Show(MessageConst.CONF_002);
            this.Shinsei_Load(sender, e);
        }
Exemple #3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void delete_Click(object sender, EventArgs e)
        {
            bool isExistCheck = false;
            for (int i = 0; i < this.userKanriDataGridView1.Rows.Count; i++)
            {
                if (this.userKanriDataGridView1.Rows[i].Cells[0].Value == null
                    || (bool)this.userKanriDataGridView1.Rows[i].Cells[0].Value == false)
                {
                    continue;
                }
                using (var context = new MyContext())
                {
                    long condtion = Convert.ToInt64(this.userKanriDataGridView1.Rows[i].Cells["USER_ID"].Value.ToString());
                    var u = context.UserMst.Single(x => x.USER_ID == condtion);
                    u.DELETE_FLG = 1;
                    u.CRE_DATE = System.DateTime.Now.ToString();
                    context.SaveChanges();
                }
                isExistCheck = true;
            }
            if (!isExistCheck)
            {
                MessageBox.Show(
                    MessageConst.ERR_005,
                    "入力エラー",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Warning);

                return;
            }
            MessageBox.Show(MessageConst.CONF_005);
            this.searchAction(ref userKanriDataGridView1, this);
        }