string getshortvouchtype(gv.vouchertype vt) { string v = ""; switch (vt) { case gv.vouchertype.CASH_RECEIPT: v = "CR"; break; case gv.vouchertype.CASH_PAYMENT: v = "CP"; break; case gv.vouchertype.BANK_DEPOSIT: v = "BD"; break; case gv.vouchertype.BANK_WITHDRAW: v = "BW"; break; case gv.vouchertype.journal: v = "JV"; break; } return(v); }
gv.vouchertype GetVouchertype(string vt) { gv.vouchertype v = gv.vouchertype.unassigned; switch (vt) { case "CR": v = gv.vouchertype.CASH_RECEIPT; break; } return(v); }
public voucher(gv.mode md, int num, gv.vouchertype typ, DateTime vouchdate) { VouchTyp = typ; VouchDate = vouchdate; Num = num; Mode = md; Size = new Size(500, 500); AutoScroll = true; WindowState = FormWindowState.Maximized; Load += new EventHandler(load); lbl1 = new Label { Text = "VOUCHER NUMBER", Parent = this, Location = new Point(0, 0), AutoSize = true }; tb1 = new TextBox { Parent = this, Location = new Point(150, 0), Width = 300 }; lbl2 = new Label { Text = "VOUCHER TYPE", Parent = this, Location = new Point(0, 30) }; cb1 = new ComboBox { DataSource = Enum.GetValues(typeof(gv.vouchertype)), Parent = this, Location = new Point(100, 30) }; lbl3 = new Label { Text = "VOUCHER DATE", Parent = this, Location = new Point(0, 60) }; dtp = new DateTimePicker { Parent = this, Location = new Point(100, 60) }; dgv = new DataGridView { Parent = this, Location = new Point(0, 90), Width = 475, Height = 300 }; btn1 = new Button { Text = "&SAVE", Parent = this, Location = new Point(200, 390) }; btn2 = new Button { Text = "&DELETE", Parent = this, Location = new Point(300, 390) }; }