public static FormMasterRealm Map(this FormMaster source) { return(new FormMasterRealm(source.Tanar.Map()) { Uid = source.Uid }); }
public async Task <IActionResult> Put(int id, [FromBody] FormMaster _FormMaster) { if (id != _FormMaster.Id) { return(BadRequest()); } _context.Entry(_FormMaster).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FormMasterExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
private void btnNextPassword_Click(object sender, EventArgs e) { if (textBoxPassword.Text == "") { MessageBox.Show("Harap diisi terlebih dahulu"); textBoxPassword.Clear(); textBoxPassword.Focus(); } else if (DecryptPassword(listUser[0].Password) == textBoxPassword.Text) { // berhasil masuk MessageBox.Show("Selamat datang, " + listUser[0].Nama); this.Hide(); FormMaster frmMaster = new FormMaster(); //frmMaster.iconPictureBoxUser frmMaster.labelNamaUser.Text = listUser[0].Username; frmMaster.labelJabatanUser.Text = listUser[0].Jabatan.Nama; frmMaster.ShowDialog(); this.Close(); } else if (DecryptPassword(listUser[0].Password) != textBoxPassword.Text) { // salah password MessageBox.Show("Password yang anda masukkan salah"); textBoxPassword.Clear(); textBoxPassword.Focus(); } }
public FormTambahNotaJual(Form callingForm, int pIdUser) { mainForm = callingForm as FormMaster; InitializeComponent(); idUser = pIdUser; }
public async Task <ActionResult <FormMaster> > Post([FromBody] FormMaster _FormMaster) { _context.FormMaster.Add(_FormMaster); await _context.SaveChangesAsync(); //return CreatedAtAction("GetFormMaster", new { id = _FormMaster.Id }, _FormMaster); return(CreatedAtAction(nameof(Get), new { id = _FormMaster.Id }, _FormMaster)); }
public FormUbahPegawai(Form callingForm, string keteranganStatus) { mainForm = callingForm as FormMaster; InitializeComponent(); statusUser = keteranganStatus; if (keteranganStatus == "Belum Aktif") { comboBoxStatusPegawai.Visible = false; labelStatus.Text = "Belum Aktif"; comboBoxJabatanPegawai.Focus(); } else { labelStatus.Visible = false; comboBoxStatusPegawai.Focus(); } }
public List <FormMaster> GetFormLayout(string Page) { var res = new List <FormMaster>(); try { conn.ConnectionString = General.Configuration.ToString(); using (var connection = conn) { connection.Open(); string sql = "select*from Master_Form where NamaForm='" + Page + "' order by Urutan asc"; using (var command = new SqlCommand(sql, connection)) { command.CommandTimeout = 0; using (var reader = command.ExecuteReader()) { while (reader.Read()) { var d = new FormMaster(); Type type = d.GetType(); PropertyInfo[] props = type.GetProperties(); foreach (var p in props) { if (null != p && p.CanWrite) { if (p.PropertyType.Name.ToString() != "IFormFile" && p.Name != "Result") { p.SetValue(d, reader[p.Name].ToString(), null); } } } res.Add(d); } } } } } catch (Exception ex) { throw ex; } return(res); }
public override void Prepare() { base.Prepare(); Student student = this._studentDataService.GetStudent(this.ActiveProfile); foreach (FormMaster formMaster1 in student.Osztalyfonokok) { FormMaster formMaster = formMaster1; if (formMaster.Tanar?.Alkalmazott != null && formMaster.Tanar.Alkalmazott.HasAnyPublicContact) { ClassGroup classGroup = student.OsztalyCsoportok.FirstOrDefault <ClassGroup>((Func <ClassGroup, bool>)(x => x.OsztalyfonokUid == formMaster.Uid && x.IsAktiv)); if (classGroup != null) { formMaster.ClassGroup = classGroup; this.FormMasters.Add(formMaster); } } } }
private void btnNextBuatPassword_Click(object sender, EventArgs e) { if (textBoxNewPassword.Text == "" || textBoxRePassword.Text == "") { MessageBox.Show("Harap di isi terlebih dahulu"); textBoxNewPassword.Clear(); textBoxRePassword.Clear(); textBoxNewPassword.Focus(); } else if (textBoxNewPassword.Text.Length < 8) { MessageBox.Show("Password minimal 8 karakter"); } else if (textBoxRePassword.Text != textBoxNewPassword.Text) { MessageBox.Show("Harap ketikkan ulang password dengan benar"); textBoxNewPassword.Clear(); textBoxRePassword.Clear(); textBoxNewPassword.Focus(); } else if (textBoxRePassword.Text == textBoxNewPassword.Text) { string hasil = User.AktifkanUser(listUser[0].Username.ToString(), textBoxNewPassword.Text); if (hasil == "1") { MessageBox.Show("Selamat datang, " + listUser[0].Nama); this.Hide(); FormMaster frmMaster = new FormMaster(); //frmMaster.iconPictureBoxUser frmMaster.labelNamaUser.Text = listUser[0].Username; frmMaster.labelJabatanUser.Text = listUser[0].Jabatan.Nama; frmMaster.ShowDialog(); this.Close(); } } }
private void btnLogin_Click(object sender, EventArgs e) { if (check_Field() == true) { errorProvider1.Clear(); bool login = LC.Check_Login(txtUsername.Text, txtPassword.Text); if (login == true) { string role = LC.Get_RoleID_User(txtUsername.Text, txtPassword.Text); int user_id = int.Parse(LC.Get_UserID(txtUsername.Text, txtPassword.Text)); FormMaster FM = new FormMaster(user_id); if (role == "ADM") { FM.Set_Visible_Admin(); FM.setToolStripUser("User : Admin - " + txtUsername.Text); } else if (role == "TCH") { FM.Set_Visible_Teacher(); FM.setToolStripUser("User : Teacher - " + txtUsername.Text); } else if (role == "STD") { FormQuis FQ = new FormQuis(user_id); FQ.ShowDialog(); FM.setToolStripUser("User : Student - " + txtUsername.Text); } FM.ShowDialog(); this.Close(); } else { MessageBox.Show("Sorry...! Username dan Passwodd Failed", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning); //resetForm(); } } }
public FormTambahMerek(Form callingForm) { mainForm = callingForm as FormMaster; //this.mainForm = callingForm; InitializeComponent(); }
public FormDetailNotaJual(Form callingForm, string user) { mainForm = callingForm as FormMaster; InitializeComponent(); hakAkses = user; }
public FormTambahPelanggan(Form callingForm) { mainForm = callingForm as FormMaster; InitializeComponent(); }
public FormTambahKategori(Form callingForm) { mainForm = callingForm as FormMaster; InitializeComponent(); }
public FormTambahSupplier(Form callingForm) { mainForm = callingForm as FormMaster; InitializeComponent(); }
public FormUbahMerek(Form callingForm) { mainForm = callingForm as FormMaster; InitializeComponent(); }
// Draws all legend text (and optional Icon beside) for every MapItem // Returns the number of items missed off the legend due to size constraints static int DrawLegend(Font font, Graphics imageGraphic) { if (FormMaster.legendItems.Count == 0) { return(0); } Dictionary <int, string> overridingLegendText = FormMaster.GatherOverriddenLegendTexts(); List <int> drawnGroups = new List <int>(); // Calculate the total height of all legend strings with their plot icons beside, combined int legendTotalHeight = 0; foreach (MapItem mapItem in FormMaster.legendItems) { // Skip legend groups that are merged/overridden and have already been accounted for if (drawnGroups.Contains(mapItem.legendGroup) && overridingLegendText.ContainsKey(mapItem.legendGroup)) { continue; } legendTotalHeight += Math.Max( (int)Math.Ceiling(imageGraphic.MeasureString(mapItem.GetLegendText(false), font, legendBounds).Height), SettingsPlot.IsIconOrTopographic() ? SettingsPlotIcon.iconSize : 0); drawnGroups.Add(mapItem.legendGroup); } int skippedLegends = 0; // How many legend items did not fit onto the map // The initial Y coord where first legend item should be written, in order to Y-center the entire legend int legendCaretHeight = (mapDimension / 2) - (legendTotalHeight / 2); // Reset the drawn groups list, as we need to iterate over the items again drawnGroups = new List <int>(); // Loop over every MapItem and draw the legend foreach (MapItem mapItem in FormMaster.legendItems) { // Skip legend groups that are merged/overridden and have already been drawn if (drawnGroups.Contains(mapItem.legendGroup) && overridingLegendText.ContainsKey(mapItem.legendGroup)) { continue; } // Calculate positions and color for legend text (plus icon) int fontHeight = (int)Math.Ceiling(imageGraphic.MeasureString(mapItem.GetLegendText(false), font, legendBounds).Height); PlotIcon icon = mapItem.GetIcon(); Image plotIconImg = SettingsPlot.IsIconOrTopographic() ? icon.GetIconImage() : null; Color legendColor = SettingsPlot.IsTopographic() ? SettingsPlotTopograph.legendColor : mapItem.GetLegendColor(); Brush textBrush = new SolidBrush(legendColor); int iconHeight = SettingsPlot.IsIconOrTopographic() ? plotIconImg.Height : 0; int legendHeight = Math.Max(fontHeight, iconHeight); // If the icon is taller than the text, offset the text it so it sits Y-centrally against the icon int textOffset = 0; if (iconHeight > fontHeight) { textOffset = (iconHeight - fontHeight) / 2; } // If the legend text/item fits on the map vertically if (legendCaretHeight > 0 && legendCaretHeight + legendHeight < mapDimension) { if (SettingsPlot.IsIconOrTopographic()) { imageGraphic.DrawImage(plotIconImg, (float)(legendIconX - (plotIconImg.Width / 2d)), (float)(legendCaretHeight - (plotIconImg.Height / 2d) + (legendHeight / 2d))); } imageGraphic.DrawString(mapItem.GetLegendText(false), font, textBrush, new RectangleF(legendXMin, legendCaretHeight + textOffset, legendWidth, legendHeight)); } else { skippedLegends++; } drawnGroups.Add(mapItem.legendGroup); legendCaretHeight += legendHeight; // Move the 'caret' down for the next item, enough to fit the icon and the text } GC.Collect(); return(skippedLegends); }