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("لم تتم عملية الحفظ هناك خطأ ما تأكد انك مازلت متصل بقاعدة البيانات"); }