Beispiel #1
0
        private void SaveDocType()
        {
            string cmd = "INSERT INTO DocumentsType (Name,IconUrl) VALUES ('" + txtDocType.Text.Trim() + @"','" + picIcon.Tag.ToString() + "')";

            if (Cv_Session.ExecuteCommand(cmd))
            {
                cmd       = "SELECT MAX(Id) FROM DocumentsType";
                DocTypeId = int.Parse(Cv_Session.GetFieldText(cmd));

                MessageBox.Show("تم الحفظ بنجاح ");
                list.LoadDocType(false);
                SetEventList();
                return;
            }
            MessageBox.Show("لم تتم عملية الحفظ هناك خطأ ما تأكد انك مازلت متصل بقاعدة البيانات");
        }
Beispiel #2
0
        private void DeleteDocSelect()
        {
            DialogResult rs = MessageBox.Show("هل انت متأكد من عملية الحذف ", "تنبيه حذف", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (rs == DialogResult.No)
            {
                return;
            }

            string cmd = " DELETE FROM Documents WHERE Id=" + DocId;

            if (Cv_Session.ExecuteCommand(cmd))
            {
                DocId = 0;

                LoadDocList(false);
            }
            else
            {
                MessageBox.Show("خطأ!" + Cv_Session.DbErrorMessage);
            }
        }
Beispiel #3
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (!CheckControl())
            {
                return;
            }
            string cmd = " UPDATE Users SET UserName='******',";

            cmd += " UserPassword='******',";
            cmd += " AlertByDayAfter=" + txtDayAlert.Text;
            cmd += " , StartOpenSystem='" + ckhAlertIsOpen.Checked.ToString() + "' WHERE Id=1";

            if (Cv_Session.ExecuteCommand(cmd))
            {
                MessageBox.Show("تم تحديث البيانات بنجاح ");
            }

            frmMain.Instance.MetroUser.Text = "Welcome \r\n" + txtUserName.Text;
            if (picUser.Image != null && picUser.Tag != null)
            {
                SaveUserPic();
            }
        }