Esempio n. 1
0
        private void lbl_replayLetter_Click(object sender, EventArgs e)
        {
            Frm_CreateLetter fm = new Frm_CreateLetter();
            int item            = dgv_ReciveLetter.SelectedCells.Count;

            if (item == 0)
            {
                MessageBox.Show("لطفا سطاری را انتخاب کنید", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (item > 0)
            {
                if (Convert.ToInt16(dgv_ReciveLetter.CurrentRow.Cells["AnswerType"].Value) == 1)
                {
                    if (Convert.ToDateTime(dgv_ReciveLetter.CurrentRow.Cells["mohlat"].Value.ToString()) < Convert.ToDateTime(PublicVariebale.ToDayDate))
                    {
                        MessageBox.Show("مهلت پاسخ نامه گذشته است", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                }

                fm.getFormtype     = 1;
                fm.gLetterNum      = dgv_ReciveLetter.CurrentRow.Cells["LetterNumber"].Value.ToString();
                fm.getLetterID     = Convert.ToInt32(dgv_ReciveLetter.CurrentRow.Cells["Letter_ID"].Value);
                fm.gReplay         = 1;
                fm.TopMost         = true;
                fm.lbl_replay.Text = "پاسخ نامه به شماره : " + dgv_ReciveLetter.CurrentRow.Cells["LetterNumber"].Value.ToString() + "مربوط به : " + dgv_ReciveLetter.CurrentRow.Cells["UserSender"].Value.ToString() + "می باشد";
                fm.ShowDialog();
            }
        }
Esempio n. 2
0
        private void lbl_insertletter_Click(object sender, EventArgs e)
        {
            var query  = (from u in DBCommon.Context.UserAccess where u.UserID == PublicVariebale.gUserID where u.SystemPartID == 21 select u);
            var result = query.ToList();

            if (result.Count > 0)
            {
                formclosing();
                FormNumber        = 12;
                fm_cl             = new Frm_CreateLetter();
                fm_cl.getFormtype = 1;///insert
                fm_cl.Show();
                fm_cl.TopMost = true;
            }
            else
            {
                lbl_insertletter.Text = "شما به این بخش دسترسی ندارید";
            }
        }
Esempio n. 3
0
        private void Edit_Letter_Click(object sender, EventArgs e)
        {
            int item = dgv_Drafts.SelectedCells.Count;

            if (item > 0)
            {
                Frm_CreateLetter fm = new Frm_CreateLetter();
                //fm.MdiParent = mainuser;
                fm.TopMost     = true;
                fm.getFormtype = 2;///edit
                fm.getLetterID = Convert.ToInt32(dgv_Drafts.CurrentRow.Cells["LetterID"].Value);
                this.Close();
                fm.Show();
                showdrafts(SearchDrafts());
            }
            else
            {
                MessageBox.Show("برای ویرایش نامه ابتدا نامه ای را انتخاب کنید", "ویرایش", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }