Example #1
0
        private void Load_Chart()
        {
            try
            {
                TreeNode baseNode = new TreeNode("");

                dspub.Clear();
                dspub         = puclass.GetCompanyInfo();
                baseNode.Text = dspub.Tbl_Organiztion[0].OrganiztionName;
                CmbUpUnit.Items.Clear();
                CmbUpUnit.Items.Add(dspub.Tbl_Organiztion[0].OrganiztionName);

                txtUnitName.Clear();
                dsunit.Clear();
                dsunit = unitclass.GetUnits();

                for (int i = 1; i <= dsunit.Tbl_Unit.Rows.Count; i++)
                {
                    InsertTree(baseNode, dsunit.Tbl_Unit[i - 1].UnitName.Trim(), dsunit.Tbl_Unit[i - 1].UpperUnit.Trim());
                    CmbUpUnit.Items.Add(dsunit.Tbl_Unit[i - 1].UnitName.Trim());
                }

                treeView1.Nodes.Clear();
                treeView1.Nodes.Add(baseNode);
                treeView1.ExpandAll();

                CmbUpUnit.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                mesg.Error("خطا", ex.Message);
            }
        }
Example #2
0
        private void BtnInsert_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtPriorityName.Text.Trim() != "")
                {
                    if (BtnEdit.Enabled == true)             //Insert
                    {
                        mPriorityclass.InsertMailPriority(txtPriorityName.Text.Trim());
                    }
                    else if (BtnEdit.Enabled == false)       //Update
                    {
                        mPriorityclass.EditMailPriority(DataGridView.SelectedRows[0].Cells["PriorityName"].Value.ToString(), txtPriorityName.Text.Trim());
                    }
                }
                else
                {
                    mesg.Warning("خطا", "لطفا نوع اولویت نامه را وارد کنید!");
                }
            }
            catch (Exception ex)
            {
                mesg.Error("خطا", ex.Message);
            }

            Load_DataGridView();
            BtnEdit.Enabled   = true;
            BtnRemove.Enabled = true;
        }
Example #3
0
        private void BtnRemove_Click(object sender, EventArgs e)
        {
            try
            {
                if (DataGridView.SelectedRows.Count == 1)
                {
                    if (DataGridView.SelectedRows[0].Cells["AccessName"].Value.ToString().Trim() != "مدير ارشد")
                    {
                        accessclass.RemoveAccess(DataGridView.SelectedRows[0].Cells["AccessName"].Value.ToString());
                    }
                    else
                    {
                        mesg.Warning("خطا", "سطح دسترسی مدیر ارشد قابل حذف نمی باشد!");
                    }
                }
                else
                {
                    mesg.Warning("خطا", "لطفا سطح دسترسی مورد نظر را انتخاب کنید!");
                }
            }
            catch (Exception ex)
            {
                mesg.Error("خطا", ex.Message);
            }

            Load_DataGridView();
        }
Example #4
0
        private void InsertImportMail_Load(object sender, EventArgs e)
        {
            try
            {
                CmbTopic.Items.Clear();
                dsmTopic = mTopicclass.GetMailTopics();
                for (int i = 1; i <= dsmTopic.Tbl_MailTopic.Rows.Count; i++)
                {
                    CmbTopic.Items.Add(dsmTopic.Tbl_MailTopic[i - 1].TopicName.Trim());
                }

                CmbSecurity.Items.Clear();
                dsmSecurity = mSecurityclass.GetMailSecuritys();
                for (int i = 1; i <= dsmSecurity.Tbl_MailSecurity.Rows.Count; i++)
                {
                    CmbSecurity.Items.Add(dsmSecurity.Tbl_MailSecurity[i - 1].SecurityName.Trim());
                }

                CmbPriority.Items.Clear();
                dsmPriority = mPriorityclass.GetMailPrioritys();
                for (int i = 1; i <= dsmPriority.Tbl_MailPriority.Rows.Count; i++)
                {
                    CmbPriority.Items.Add(dsmPriority.Tbl_MailPriority[i - 1].PriorityName.Trim());
                }

                CmbCondition.Items.Clear();
                dsmCondition = mConditionclass.GetMailConditions();
                for (int i = 1; i <= dsmCondition.Tbl_MailCondition.Rows.Count; i++)
                {
                    CmbCondition.Items.Add(dsmCondition.Tbl_MailCondition[i - 1].ConditionName.Trim());
                }

                CmbClerks.Items.Clear();
                dsclerk = clerkclass.GetClerks();
                for (int i = 1; i <= dsclerk.Tbl_Clerk.Rows.Count; i++)
                {
                    CmbInternalCC.Items.Add(dsclerk.Tbl_Clerk[i - 1].Name_.Trim() + " " + dsclerk.Tbl_Clerk[i - 1].Family.Trim());
                    CmbClerks.Items.Add(dsclerk.Tbl_Clerk[i - 1].Name_.Trim() + " " + dsclerk.Tbl_Clerk[i - 1].Family.Trim());
                }

                CmbPersons.Items.Clear();
                dsexoffice = exofficeclass.GetExOffice();
                for (int i = 1; i <= dsexoffice.Tbl_ExOffice.Rows.Count; i++)
                {
                    CmbPersons.Items.Add(dsexoffice.Tbl_ExOffice[i - 1].PersonName.Trim());
                }

                txtDate.Text = Persia.Calendar.ConvertToPersian(DateTime.Now).Simple.ToString();
            }
            catch (Exception ex)
            {
                mesg.Error("خطا", ex.Message);
            }
        }
Example #5
0
 public void Load_DataGridView()
 {
     try
     {
         dsmessage = messageclass.GetSendedMessages(online_Username);
         dsmessage.AcceptChanges();
         DataGridView.DataSource = dsmessage.Tbl_MessageBox;
         txtMsgName.Clear();
         txtMsgText.Clear();
     }
     catch (Exception ex)
     {
         mesg.Error("خطا", ex.Message);
     }
 }
Example #6
0
 private void BtnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtOrganiztionName.Text.Trim() != "")
         {
             if (ImageDialog.FileName == "openFileDialog1")
             {
                 ImageDialog.FileName = "";
             }
             pubclass.UpdateCompanyInfo(txtOrganiztionName.Text.Trim(), txtTel1.Text.Trim(), txtTel2.Text.Trim(),
                                        txtTel3.Text.Trim(), txtFax1.Text.Trim(), txtFax2.Text.Trim(), txtAddress1.Text.Trim(),
                                        txtAddress2.Text.Trim(), ImageDialog.FileName);
             mesg.Information("توجه", "اطلاعات سازمان با موفقیت ذخیره شد. ");
         }
         else
         {
             mesg.Warning("توجه", "لطفا نام سازمان را وارد کنید.");
         }
     }
     catch (Exception ex)
     {
         mesg.Error("خطا", ex.Message);
     }
 }
Example #7
0
 public void Load_DataGridView()
 {
     try
     {
         dsmail = mailclass.GetDrafts(online_Username);
         dsmail.AcceptChanges();
         DataGridView.DataSource = dsmail.Tbl_Draft;
         txtDraftName.Clear();
         richTextBox1.Clear();
         txtSearch.Clear();
     }
     catch (Exception ex)
     {
         mesg.Error("خطا", ex.Message);
     }
 }
Example #8
0
 private void BtnView_Click(object sender, EventArgs e)
 {
     try
     {
         if (DataGridView.SelectedRows.Count == 1)
         {
             OCA.WinUI.BaseForms.BaseReportForm  reportform = new OCA.WinUI.BaseForms.BaseReportForm();
             OCA.WinUI.Kartabl.Report.MailReport reportfile = new OCA.WinUI.Kartabl.Report.MailReport();
             reportfile.SetParameterValue("Mail_Date", DataGridView.SelectedRows[0].Cells["Mail_Date"].Value.ToString().Trim());
             reportfile.SetParameterValue("Mail_Text", DataGridView.SelectedRows[0].Cells["Mail_Text"].Value.ToString().Trim());
             reportfile.SetParameterValue("Mail_Refer", DataGridView.SelectedRows[0].Cells["Refer_Description"].Value.ToString().Trim());
             reportfile.SetParameterValue("Mail_Name", DataGridView.SelectedRows[0].Cells["Mail_Name"].Value.ToString().Trim());
             reportform.crystalReportViewer1.ReportSource = reportfile;
             reportform.Show();
         }
         else
         {
             mesg.Warning("خطا", "لطفا نامه مورد نظر را انتخاب کنید!");
         }
     }
     catch (Exception ex)
     {
         mesg.Error("خطا", ex.Message);
     }
 }
Example #9
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            try
            {
                richTextBox1.Text = pubclass.SqlInjection(richTextBox1.Text);

                str_MailNumber = dsmail.Tbl_MailBox[CmbName.SelectedIndex].Mail_Num.ToString().Trim();

                if (CmbName.Text == "")
                {
                    throw new Exception("لطفا عنوان نامه را وارد کنید!");
                }
                if (CmbName.SelectedIndex == -1)
                {
                    throw new Exception("لطفا عنوان نامه را درست وارد کنید!");
                }
                if (richTextBox1.Text == "")
                {
                    throw new Exception("متن ارجاع خالی است!");
                }

                mailclass.Update_Mail(str_MailNumber, txtDate.Text.Trim(), CmbTopic.Text.Trim(), CmbPriority.Text.Trim(),
                                      CmbSecurity.Text.Trim(), CmbCondition.Text.Trim(), richTextBox1.Text.Trim(), txtSingerName.Text.Trim(),
                                      str_PicSign);

                mesg.Information("توجه", "نامه " + CmbName.Text.Trim() + " با موفقیت ذخیره شد.");
                this.Close();
            }
            catch (Exception ex)
            {
                mesg.Error("خطا", ex.Message);
            }
        }
Example #10
0
 public void Load_DataGridView()
 {
     try
     {
         dsmail = mailclass.GetReceivedDabirkhanehMails();
         dsmail.AcceptChanges();
         DataGridView.DataSource = dsmail.Tbl_MailBox;
         txtName.Clear();
         txt_Search.Clear();
         lst_Files.Items.Clear();
     }
     catch (Exception ex)
     {
         mesg.Error("خطا", ex.Message);
     }
 }
Example #11
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            try
            {
                richTextBox1.Text = pubclass.SqlInjection(richTextBox1.Text);

                if (txtAttachName.Text == "")
                {
                    mesg.Warning("توجه", "لطفا نام پیش نویس را وارد کنید!");
                    txtAttachName.Focus();
                }
                else if (richTextBox1.Text == "")
                {
                    mesg.Warning("توجه", "متن پیش نویس خالی است!");
                    richTextBox1.Focus();
                }
                else
                {
                    mailclass.InsertDraft(online_Username, txtAttachName.Text.Trim(), richTextBox1.Text.Trim());
                    mesg.Information("موفقیت", "پیش نویس با موفقیت ذخیره شد.");
                    richTextBox1.Clear();
                    txtAttachName.Clear();
                    txtAttachName.Focus();
                }
            }
            catch (Exception ex)
            {
                mesg.Error("خطا", ex.Message);
            }
        }
Example #12
0
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            try
            {
                if (pubclass.IsUserValid(txt_Username.Text.Trim(), txt_Password.Text.Trim()))
                {
                    ValidUser = true;

                    MainForm mfrm = new MainForm();
                    mfrm.Online_Username = txt_Username.Text.Trim();

                    Close();
                }
            }
            catch (Exception ex)
            {
                OCA.WinUI.BaseForms.BaseMessageBox mesg = new OCA.WinUI.BaseForms.BaseMessageBox();
                mesg.Error("خطا", ex.Message);

                if (LoginFailed == 3)
                {
                    this.Close();
                }

                LoginFailed++;
                txt_Username.Clear();
                txt_Password.Clear();
                txt_Username.Focus();
            }
        }
Example #13
0
        private void BtnSend_Click(object sender, EventArgs e)
        {
            try
            {
                txtMsgText.Text = pubclass.SqlInjection(txtMsgText.Text);
                if (txtMsgName.Text.Trim() == "")
                {
                    throw new Exception("لطفا نام پیام را وارد کنید!");
                }
                string Receiver_User;
                string Receiver_Name;
                try
                {
                    Receiver_Name = dsclerk.Tbl_Clerk[CmbClerks.SelectedIndex].Name_.Trim() + " " +
                                    dsclerk.Tbl_Clerk[CmbClerks.SelectedIndex].Family.Trim();
                    Receiver_User = dsclerk.Tbl_Clerk[CmbClerks.SelectedIndex].Username.Trim();
                }
                catch { throw new Exception("لطفا گیرنده پیام را انتخاب کنید!"); }
                if (Receiver_User == online_Username)
                {
                    throw new Exception("شما می خواهید به خودتان پیام بزنید؟!!");
                }
                if (txtMsgText.Text.Trim() == "")
                {
                    throw new Exception("لطفا متن پیام را وارد کنید!");
                }

                string Online_Name = "";
                for (int i = 1; i <= dsclerk.Tbl_Clerk.Rows.Count; i++)
                {
                    if (online_Username == dsclerk.Tbl_Clerk[i - 1].Username.Trim())
                    {
                        Online_Name = dsclerk.Tbl_Clerk[i - 1].Name_.Trim() + " " + dsclerk.Tbl_Clerk[i - 1].Family.Trim();
                    }
                }
                //for Sender
                messageclass.InsertMessage(Persia.Calendar.ConvertToPersian(DateTime.Now).Simple.ToString().Trim(),
                                           txtMsgName.Text.Trim(), online_Username, online_Username, Online_Name, Receiver_User, Receiver_Name,
                                           txtMsgText.Text.Trim());
                //for Receiver
                messageclass.InsertMessage(Persia.Calendar.ConvertToPersian(DateTime.Now).Simple.ToString().Trim(),
                                           txtMsgName.Text.Trim(), Receiver_User, online_Username, Online_Name, Receiver_User, Receiver_Name,
                                           txtMsgText.Text.Trim());

                mesg.Information("توجه", "پیام مورد نظر با موفقیت ارسال شد.");
                txtMsgText.Clear();
                CmbClerks.Text = "";
                txtMsgName.Clear();
                txtMsgName.Focus();
            }
            catch (Exception ex)
            {
                mesg.Error("خطا", ex.Message);
                txtMsgName.Focus();
            }
        }
Example #14
0
        private void Load_Chart()
        {
            try
            {
                dssemat = sematclass.GetSemats();

                TreeNode baseNode = new TreeNode("");
                baseNode.Text = dssemat.Tbl_Semat[0].SematName.Trim();
                CmbUpSemat.Items.Clear();

                for (int i = 2; i <= dssemat.Tbl_Semat.Rows.Count; i++)
                {
                    InsertTree(baseNode, dssemat.Tbl_Semat[i - 1].SematName.Trim(), dssemat.Tbl_Semat[i - 1].UpperSemat.Trim());
                }
                for (int i = 1; i <= dssemat.Tbl_Semat.Rows.Count; i++)
                {
                    CmbUpSemat.Items.Add(dssemat.Tbl_Semat[i - 1].SematName.Trim());
                }

                treeView1.Nodes.Clear();
                treeView1.Nodes.Add(baseNode);
                treeView1.ExpandAll();

                txtSematName.Clear();

                if (CmbUpSemat.Items.Count != 0)
                {
                    CmbUpSemat.SelectedIndex = 0;
                }

                CmbSematGroup.Text = "";
                dssemat            = sematclass.GetSematGroups();
                CmbSematGroup.Items.Clear();
                for (int i = 1; i <= dssemat.Tbl_SematGroup.Rows.Count; i++)
                {
                    CmbSematGroup.Items.Add(dssemat.Tbl_SematGroup[i - 1].GroupName.Trim());
                }
            }
            catch (Exception ex)
            {
                mesg.Error("خطا", ex.Message);
            }
        }
Example #15
0
        private void ReferMail_Load(object sender, EventArgs e)
        {
            try
            {
                dsclerk     = clerkclass.GetNameByUsername(online_Username);
                Online_Name = dsclerk.Tbl_Clerk[0].Name_.Trim() + " " + dsclerk.Tbl_Clerk[0].Family.Trim();

                CmbClerks.Items.Clear();
                dsclerk = clerkclass.GetClerks();
                for (int i = 1; i <= dsclerk.Tbl_Clerk.Rows.Count; i++)
                {
                    CmbInternalCC.Items.Add(dsclerk.Tbl_Clerk[i - 1].Name_.Trim() + " " + dsclerk.Tbl_Clerk[i - 1].Family.Trim());
                    CmbClerks.Items.Add(dsclerk.Tbl_Clerk[i - 1].Name_.Trim() + " " + dsclerk.Tbl_Clerk[i - 1].Family.Trim());
                }

                CmbPersons.Items.Clear();
                dsexoffice = exofficeclass.GetExOffice();
                for (int i = 1; i <= dsexoffice.Tbl_ExOffice.Rows.Count; i++)
                {
                    Cmb_ExternalCC.Items.Add(dsexoffice.Tbl_ExOffice[i - 1].PersonName.Trim());
                    CmbPersons.Items.Add(dsexoffice.Tbl_ExOffice[i - 1].PersonName.Trim());
                }

                CmbMails.Items.Clear();
                dsmail = mailclass.GetMails(online_Username);
                for (int i = 1; i <= dsmail.Tbl_MailBox.Rows.Count; i++)
                {
                    CmbMails.Items.Add(dsmail.Tbl_MailBox[i - 1].Mail_Num + "#" + dsmail.Tbl_MailBox[i - 1].Mail_Name.Trim());
                }

                CmbName.Items.Clear();
                dsmail = mailclass.GetReceivedMails(online_Username);
                for (int i = 1; i <= dsmail.Tbl_MailBox.Rows.Count; i++)
                {
                    CmbName.Items.Add(dsmail.Tbl_MailBox[i - 1].Mail_Name.Trim());
                }
            }
            catch (Exception ex)
            {
                mesg.Error("خطا", ex.Message);
            }
        }
Example #16
0
        private void BtnRemove_Click(object sender, EventArgs e)
        {
            try
            {
                if (DataGridView.SelectedRows.Count == 1)
                {
                    parvandehclass.RemoveParvandeh(DataGridView.SelectedRows[0].Cells["ParvandehName"].Value.ToString());
                }
                else
                {
                    mesg.Warning("خطا", "لطفا پرونده مورد نظر را انتخاب کنید!");
                }
            }
            catch (Exception ex)
            {
                mesg.Error("خطا", ex.Message);
            }

            Load_DataGridView();
        }
Example #17
0
 private void BtnEdit_Click(object sender, EventArgs e)
 {
     try
     {
         if (DataGridView.SelectedRows.Count == 1)
         {
             txtSematGroup.Text = DataGridView.SelectedRows[0].Cells["GroupName"].Value.ToString().Trim();
             BtnEdit.Enabled    = false;
             BtnRemove.Enabled  = false;
         }
         else
         {
             mesg.Warning("خطا", "لطفا گروه سمت مورد نظر را انتخاب کنید!");
         }
     }
     catch (Exception ex)
     {
         mesg.Error("خطا", ex.Message);
     }
 }
Example #18
0
        private void BtnRemove_Click(object sender, EventArgs e)
        {
            try
            {
                if (DataGridView.SelectedRows.Count == 1)
                {
                    clerkclass.RemoveClerkGroup(DataGridView.SelectedRows[0].Cells["GroupName"].Value.ToString());
                }
                else
                {
                    mesg.Warning("خطا", "لطفا گروه کارمند مورد نظر را انتخاب کنید!");
                }
            }
            catch (Exception ex)
            {
                mesg.Error("خطا", ex.Message);
            }

            Load_DataGridView();
        }
Example #19
0
 public void Load_DataGridView()
 {
     try
     {
         dsmail = mailclass.GetInternalMails();
         dsmail.AcceptChanges();
         DataGridView.DataSource = dsmail.Tbl_MailBox;
         PicSign.Image           = global::OCA.WinUI.Properties.Resources.ArenaWarsMonitor;
         txtName.Clear();
         txtSignerName.Clear();
         txt_Search.Clear();
         lst_Files.Items.Clear();
         lst_Mails.Items.Clear();
         CmbSearchKind.SelectedIndex = 0;
     }
     catch (Exception ex)
     {
         mesg.Error("خطا", ex.Message);
     }
 }
Example #20
0
        public void Load_DataGridView()
        {
            try
            {
                dsexoffice = exofficeclass.GetExOffice();
                dsexoffice.AcceptChanges();
                DataGridView.DataSource = dsexoffice.Tbl_ExOffice;

                CmbPersonKind.SelectedIndex = 0;
                txtPersonName.Clear();
                txtTel.Clear();
                txtFax.Clear();
                txtEmail.Clear();
                txtSite.Clear();
                txtAddress.Clear();
            }
            catch (Exception ex)
            {
                mesg.Error("خطا", ex.Message);
            }
        }
Example #21
0
        public void Load_DataGridView()
        {
            try
            {
                dsmail = mailclass.GetArchivedMails(online_Username);
                dsmail.AcceptChanges();
                DataGridView.DataSource = dsmail.Tbl_MailBox;
                PicSign.Image           = global::OCA.WinUI.Properties.Resources.ArenaWarsMonitor;
                CmbParvandeh.Text       = "";
                txtSignerName.Clear();
                txt_Search.Clear();
                lst_Files.Items.Clear();
                lst_Mails.Items.Clear();
                CmbSearchKind.SelectedIndex = 0;

                CmbParvandeh.Items.Clear();
                dsparvandeh = parvandehclass.GetParvandeh();
                for (int i = 1; i <= dsparvandeh.Tbl_MailParvandeh.Rows.Count; i++)
                {
                    CmbParvandeh.Items.Add(dsparvandeh.Tbl_MailParvandeh[i - 1].ParvandehName.Trim());
                }
            }
            catch (Exception ex)
            {
                mesg.Error("خطا", ex.Message);
            }
        }
        private void BtnInsert_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtParvandehName.Text.Trim() != "")
                {
                    parvandehclass.InsertParvandeh(txtParvandehName.Text.Trim());
                }
                else
                {
                    mesg.Warning("خطا", "لطفا نام پرونده را وارد کنید!");
                }
            }
            catch (Exception ex)
            {
                mesg.Error("خطا", ex.Message);
            }

            Load_DataGridView();
        }
Example #23
0
        private void BtnInsert_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtAccessName.Text.Trim() != "")
                {
                    accessclass.InsertAccess(txtAccessName.Text.Trim(), GetCheckBox(chkCreateMail), GetCheckBox(chkEditMail),
                                             GetCheckBox(chkDraft), GetCheckBox(chkMailInbox), GetCheckBox(chkMailOutbox), GetCheckBox(chkReferMail),
                                             GetCheckBox(chkArchiveMail), GetCheckBox(chkMailHistory), GetCheckBox(chkSearchMail),
                                             GetCheckBox(chkInsertParvandeh), GetCheckBox(chkViewParvandeh), GetCheckBox(chkMsgInbox),
                                             GetCheckBox(chkMsgOutbox), GetCheckBox(chkSendMessage), GetCheckBox(chkDeletedMessage),
                                             GetCheckBox(chkInsertImportMail), GetCheckBox(chkViewImportMail), GetCheckBox(chkInsertExportMail),
                                             GetCheckBox(chkViewExportMail), GetCheckBox(chkViewInternalMail), GetCheckBox(chkDefineChart),
                                             GetCheckBox(chkViewChart), GetCheckBox(chkCompanyInfo), GetCheckBox(chkNewSemat), GetCheckBox(chkEditSemat),
                                             GetCheckBox(chkSematGroup), GetCheckBox(chkNewAccess), GetCheckBox(chkEditAccess2),
                                             GetCheckBox(chkEditAccess), GetCheckBox(chkNewClerk), GetCheckBox(chkEditClerk), GetCheckBox(chkClerkGroup),
                                             GetCheckBox(chkNewExOffice), GetCheckBox(chkEditExOffice), GetCheckBox(chkNewAddress),
                                             GetCheckBox(chkEditAddress), GetCheckBox(chkMailNumber), GetCheckBox(chkMailTopic),
                                             GetCheckBox(chkMailCondition), GetCheckBox(chkMailPriority), GetCheckBox(chkMailSecurity),
                                             GetCheckBox(chkReferenceDescription), GetCheckBox(chkColorSetting), GetCheckBox(chkFaxSetting),
                                             GetCheckBox(chkPrinterSetting), GetCheckBox(chkScanerSetting), GetCheckBox(chkEmailSetting),
                                             GetCheckBox(chkBackUp), GetCheckBox(chkNewReminder), GetCheckBox(chkEditReminder), GetCheckBox(chkNewNews),
                                             GetCheckBox(chkEditNews), GetCheckBox(chkTextComm), GetCheckBox(chkVoiceComm), GetCheckBox(chkVideoComm));


                    ClearCheckBoxes();
                    txtAccessName.Clear();

                    mesg.Information("توجه", "سطح دسترسی مورد نظر با موفقیت ثبت شد.");
                }
                else
                {
                    mesg.Warning("توجه", "لطفا نام سطح دسترسی را وارد کنید!");
                }
            }
            catch (Exception ex)
            {
                mesg.Error("خطا", ex.Message);
            }
        }
Example #24
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtPassword.Text.Trim().Length >= 4)
                {
                    if (CmbSex.Text != "")
                    {
                        if (CmbSex.Text != "مرد" && CmbSex.Text != "زن")
                        {
                            throw new Exception("لطفا جنسیت را درست انتخاب کنید!");
                        }
                    }

                    if (str_PicSign == "openFileDialog1")
                    {
                        str_PicSign = "";
                    }
                    if (str_PicImage == "openFileDialog1")
                    {
                        str_PicImage = "";
                    }

                    clerkclass.UpdateClerkAcount(online_Username, txtPassword.Text.Trim(), CmbSex.Text.Trim(),
                                                 txtAge.Text.Trim(), txtTel.Text.Trim(), txtMobile.Text.Trim(), txtExpert.Text.Trim(),
                                                 txtEmail.Text.Trim(), txtAddress.Text.Trim(), str_PicSign, str_PicImage);
                    mesg.Information("توجه", "اطلاعات کاربر با موفقیت ذخیره شد.");
                    txtPassword.Clear();
                }
                else
                {
                    mesg.Warning("توجه", "طول کلمه عبور نباید کمتر از 4 کاراکتر باشد!");
                }
            }
            catch (Exception ex)
            {
                mesg.Error("خطا", ex.Message);
            }
        }
Example #25
0
        private void CreateMail_Load(object sender, EventArgs e)
        {
            try
            {
                dsclerk     = clerkclass.GetNameByUsername(online_Username);
                Online_Name = dsclerk.Tbl_Clerk[0].Name_.Trim() + " " + dsclerk.Tbl_Clerk[0].Family.Trim();

                CmbTopic.Items.Clear();
                dsmTopic = mTopicclass.GetMailTopics();
                for (int i = 1; i <= dsmTopic.Tbl_MailTopic.Rows.Count; i++)
                {
                    CmbTopic.Items.Add(dsmTopic.Tbl_MailTopic[i - 1].TopicName.Trim());
                }

                CmbSecurity.Items.Clear();
                dsmSecurity = mSecurityclass.GetMailSecuritys();
                for (int i = 1; i <= dsmSecurity.Tbl_MailSecurity.Rows.Count; i++)
                {
                    CmbSecurity.Items.Add(dsmSecurity.Tbl_MailSecurity[i - 1].SecurityName.Trim());
                }

                CmbPriority.Items.Clear();
                dsmPriority = mPriorityclass.GetMailPrioritys();
                for (int i = 1; i <= dsmPriority.Tbl_MailPriority.Rows.Count; i++)
                {
                    CmbPriority.Items.Add(dsmPriority.Tbl_MailPriority[i - 1].PriorityName.Trim());
                }

                CmbCondition.Items.Clear();
                dsmCondition = mConditionclass.GetMailConditions();
                for (int i = 1; i <= dsmCondition.Tbl_MailCondition.Rows.Count; i++)
                {
                    CmbCondition.Items.Add(dsmCondition.Tbl_MailCondition[i - 1].ConditionName.Trim());
                }

                CmbClerks.Items.Clear();
                dsclerk = clerkclass.GetClerks();
                for (int i = 1; i <= dsclerk.Tbl_Clerk.Rows.Count; i++)
                {
                    CmbInternalCC.Items.Add(dsclerk.Tbl_Clerk[i - 1].Name_.Trim() + " " + dsclerk.Tbl_Clerk[i - 1].Family.Trim());
                    CmbClerks.Items.Add(dsclerk.Tbl_Clerk[i - 1].Name_.Trim() + " " + dsclerk.Tbl_Clerk[i - 1].Family.Trim());
                }

                CmbPersons.Items.Clear();
                dsexoffice = exofficeclass.GetExOffice();
                for (int i = 1; i <= dsexoffice.Tbl_ExOffice.Rows.Count; i++)
                {
                    Cmb_ExternalCC.Items.Add(dsexoffice.Tbl_ExOffice[i - 1].PersonName.Trim());
                    CmbPersons.Items.Add(dsexoffice.Tbl_ExOffice[i - 1].PersonName.Trim());
                }

                txtDate.Text = Persia.Calendar.ConvertToPersian(DateTime.Now).Simple.ToString();

                CmbDrafts.Items.Clear();
                dsmail = mailclass.GetDrafts(online_Username);
                for (int i = 1; i <= dsmail.Tbl_Draft.Rows.Count; i++)
                {
                    CmbDrafts.Items.Add(dsmail.Tbl_Draft[i - 1].Draft_Name.Trim());
                }

                CmbMails.Items.Clear();
                dsmail = mailclass.GetMails(online_Username);
                for (int i = 1; i <= dsmail.Tbl_MailBox.Rows.Count; i++)
                {
                    CmbMails.Items.Add(dsmail.Tbl_MailBox[i - 1].Mail_Num + "#" + dsmail.Tbl_MailBox[i - 1].Mail_Name.Trim());
                }
            }
            catch (Exception ex)
            {
                mesg.Error("خطا", ex.Message);
            }
        }
Example #26
0
        public void Load_DataGridView()
        {
            try
            {
                txtName.Clear();
                txtFamily.Clear();
                txtUsername.Clear();
                txtPassword.Clear();
                CmbAccess.Text = "";
                CmbAccess.Items.Clear();
                CmbSemat.Text = "";
                CmbSemat.Items.Clear();
                CmbUnit.Text = "";
                CmbUnit.Items.Clear();
                CmbClerkGroup.Text = "";
                CmbClerkGroup.Items.Clear();

                dsclerk = clerkclass.GetClerkGroups();
                for (int i = 1; i <= dsclerk.Tbl_ClerkGroup.Rows.Count; i++)
                {
                    CmbClerkGroup.Items.Add(dsclerk.Tbl_ClerkGroup[i - 1].GroupName.Trim());
                }

                dsunit = unitclass.GetAllUnits();
                for (int i = 1; i <= dsunit.Tbl_Unit.Rows.Count; i++)
                {
                    CmbUnit.Items.Add(dsunit.Tbl_Unit[i - 1].UnitName.Trim());
                }

                dssemat = sematclass.GetSemats();
                for (int i = 1; i <= dssemat.Tbl_Semat.Rows.Count; i++)
                {
                    CmbSemat.Items.Add(dssemat.Tbl_Semat[i - 1].SematName.Trim());
                }

                dsaccess = accessclass.GetAccess();
                for (int i = 1; i <= dsaccess.Tbl_Access.Rows.Count; i++)
                {
                    CmbAccess.Items.Add(dsaccess.Tbl_Access[i - 1].AccessName.Trim());
                }

                dsclerk = clerkclass.GetClerks();
                dsclerk.AcceptChanges();
                DataGridView.DataSource = dsclerk.Tbl_Clerk;
            }
            catch (Exception ex)
            {
                mesg.Error("خطا", ex.Message);
            }
        }
Example #27
0
        private void CmbAccessName_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                dsaccess = accessclass.GetAccess();

                chkCreateMail.Checked           = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].CreateMail.ToString().Trim());
                chkEditMail.Checked             = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].EditMail.ToString().Trim());
                chkDraft.Checked                = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].Draft.ToString().Trim());
                chkMailInbox.Checked            = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].MailInbox.ToString().Trim());
                chkMailOutbox.Checked           = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].MailOutbox.ToString().Trim());
                chkReferMail.Checked            = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].ReferMail.ToString().Trim());
                chkArchiveMail.Checked          = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].ArchiveMail.ToString().Trim());
                chkMailHistory.Checked          = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].MailHistory.ToString().Trim());
                chkSearchMail.Checked           = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].SearchMail.ToString().Trim());
                chkInsertParvandeh.Checked      = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].InsertParvandeh.ToString().Trim());
                chkViewParvandeh.Checked        = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].ViewParvandeh.ToString().Trim());
                chkMsgInbox.Checked             = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].MsgInbox.ToString().Trim());
                chkMsgOutbox.Checked            = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].MsgOutbox.ToString().Trim());
                chkSendMessage.Checked          = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].SendMessage.ToString().Trim());
                chkDeletedMessage.Checked       = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].DeletedMessage.ToString().Trim());
                chkInsertImportMail.Checked     = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].InsertImportMail.ToString().Trim());
                chkViewImportMail.Checked       = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].ViewImportMail.ToString().Trim());
                chkInsertExportMail.Checked     = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].InsertExportMail.ToString().Trim());
                chkViewExportMail.Checked       = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].VeiwExportMail.ToString().Trim());
                chkViewInternalMail.Checked     = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].ViewInternalMail.ToString().Trim());
                chkDefineChart.Checked          = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].DefineChart.ToString().Trim());
                chkViewChart.Checked            = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].ViewChart.ToString().Trim());
                chkCompanyInfo.Checked          = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].CompanyInfo.ToString().Trim());
                chkNewSemat.Checked             = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].NewSemat.ToString().Trim());
                chkEditSemat.Checked            = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].EditSemat.ToString().Trim());
                chkSematGroup.Checked           = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].SematGroup.ToString().Trim());
                chkNewAccess.Checked            = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].NewAccess.ToString().Trim());
                chkEditAccess2.Checked          = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].EditAccess2.ToString().Trim());
                chkEditAccess.Checked           = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].EditAccess.ToString().Trim());
                chkNewClerk.Checked             = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].NewClerk.ToString().Trim());
                chkEditClerk.Checked            = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].EditClerk.ToString().Trim());
                chkClerkGroup.Checked           = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].ClerkGroup.ToString().Trim());
                chkNewExOffice.Checked          = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].NewExOffice.ToString().Trim());
                chkEditExOffice.Checked         = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].EditExOffice.ToString().Trim());
                chkNewAddress.Checked           = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].NewAddress.ToString().Trim());
                chkEditAddress.Checked          = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].EditAddress.ToString().Trim());
                chkMailNumber.Checked           = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].MailNumber.ToString().Trim());
                chkMailTopic.Checked            = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].MailTopic.ToString().Trim());
                chkMailCondition.Checked        = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].MailCondition.ToString().Trim());
                chkMailPriority.Checked         = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].MailPriority.ToString().Trim());
                chkMailSecurity.Checked         = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].MailSecurity.ToString().Trim());
                chkReferenceDescription.Checked = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].ReferenceDescription.ToString().Trim());
                chkColorSetting.Checked         = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].ColorSetting.ToString().Trim());
                chkFaxSetting.Checked           = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].FaxSetting.ToString().Trim());
                chkPrinterSetting.Checked       = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].PrinterSetting.ToString().Trim());
                chkScanerSetting.Checked        = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].ScanerSetting.ToString().Trim());
                chkEmailSetting.Checked         = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].EmailSetting.ToString().Trim());
                chkBackUp.Checked               = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].Back_Up.ToString().Trim());
                chkNewReminder.Checked          = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].NewReminder.ToString().Trim());
                chkEditReminder.Checked         = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].EditReminder.ToString().Trim());
                chkNewNews.Checked              = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].NewNews.ToString().Trim());
                chkEditNews.Checked             = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].EditNews.ToString().Trim());
                chkTextComm.Checked             = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].TextComm.ToString().Trim());
                chkVoiceComm.Checked            = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].VoiceComm.ToString().Trim());
                chkVideoComm.Checked            = SetCheckBox(dsaccess.Tbl_Access[CmbAccessName.SelectedIndex].VideoComm.ToString().Trim());
            }
            catch (Exception ex)
            {
                mesg.Error("خطا", ex.Message);
            }
        }