public SellForm() { InitializeComponent(); db = new DataClasses1DataContext(); button2.Enabled = false; msItems = (from x in db.MsItems select x).ToArray(); dataGridView1.DataSource = msItems; dataGridView1.Columns[0].Visible = false; step = 0; itemId = -1; invId = -1; idx = -1; cart = new List<string>(); grand = 0; months = new List<string>(); months.Add("I"); months.Add("II"); months.Add("III"); months.Add("IV"); months.Add("V"); months.Add("VI"); months.Add("VII"); months.Add("VIII"); months.Add("IX"); months.Add("X"); months.Add("XI"); months.Add("XII"); label6.Text = "No : " + generateInvoiceNo(); }
public PrintInvoiceForm(String invoice, DateTime sellDate) { InitializeComponent(); this.invoice = invoice; lbInvoice.Text = invoice; lbDate.Text = sellDate.ToShortDateString(); db = new DataClasses1DataContext(); }
public ViewReportForm() { InitializeComponent(); db = new DataClasses1DataContext(); dateTimePicker1.Format = DateTimePickerFormat.Custom; dateTimePicker1.CustomFormat = "MM/yyyy"; refreshTable(); }
public CreateJobForm(int id) { InitializeComponent(); showComponents(false); db = new DataClasses1DataContext(); HeaderProject obj = (from x in db.HeaderProjects where x.Id == id select x).First(); lbName.Text = obj.Name; int h1 = lbNote.Top - lbNote.Bottom; lbNote.Text = obj.Note; int h2 = lbNote.Top - lbNote.Bottom; int diff = h2 - h1; label1.Top += diff; label2.Top += diff; label4.Top += diff; label5.Top += diff; label7.Top += diff; label8.Top += diff; label9.Top += diff; label10.Top += diff; label11.Top += diff; this.MaximumSize = new Size(this.Size.Width,this.Size.Height + diff); this.Size = new Size(this.Size.Width, this.Size.Height + diff); var datas = from dp in db.DetailProjects join ii in db.ItemInventories on dp.InventoryId equals ii.Id join mi in db.MsItems on ii.ItemId equals mi.Id where dp.HeaderId == id select new { mi.Name, dp.Amount, ii.Unit, dp.Price, Total = (dp.Amount * dp.Price) }; decimal gTotal = (from x in datas select x.Total).Sum(); decimal gAmount = (from x in datas select x.Amount).Sum(); //dataGridView1.DataSource = datas; dataGridView1.Columns.Add("Name","Name"); dataGridView1.Columns.Add("Amount", "Amount"); dataGridView1.Columns.Add("Unit", "Unit"); dataGridView1.Columns.Add("Price", "Price"); dataGridView1.Columns.Add("Total", "Total"); foreach (var data in datas) { dataGridView1.Rows.Add(data.Name, data.Amount, data.Unit, data.Price, data.Total); } dataGridView1.Rows.Add("", "", "", "", ""); dataGridView1.Rows.Add("Grand Total", gAmount,"","",gTotal); }
public ViewProjectForm() { InitializeComponent(); button1.Enabled = false; button2.Enabled = false; button3.Enabled = false; button4.Enabled = false; db = new DataClasses1DataContext(); searchBy = -1; index = -1; showAllData(); }
public AddNewItemForm() { InitializeComponent(); db = new DataClasses1DataContext(); MsCategory[] temp = (from x in db.MsCategories select x).ToArray(); cmbType.Items.Add(" - New Category -"); foreach (MsCategory t in temp) { cmbType.Items.Add(t.Name); } }
public AddStockForm() { InitializeComponent(); db = new DataClasses1DataContext(); msItems = (from x in db.MsItems select x).ToArray(); dataGridView1.DataSource = msItems; dataGridView1.Columns[0].Visible = false; step = 0; itemId = -1; enableComponents(false); }
public CreateDealForm(int id) { InitializeComponent(); showComponents(false); db = new DataClasses1DataContext(); obj = (from x in db.HeaderProjects where x.Id == id select x).First(); lbClient.Text = obj.Client; lbClient1.Text = obj.Client; lbName.Text = obj.Name; }
public ProjectDetailForm(int id) { InitializeComponent(); db = new DataClasses1DataContext(); this.id = id; HeaderProject obj = (from x in db.HeaderProjects where x.Id == id select x).First(); txClient.Text = obj.Client; txName.Text = obj.Name; txNote.Text = obj.Note; txPay.Text = obj.Payment.ToString(); txProgress.Text = obj.Progress.ToString(); }
public CreateProjectForm() { InitializeComponent(); db = new DataClasses1DataContext(); button2.Enabled = false; msItems = (from x in db.MsItems select x).ToArray(); dataGridView1.DataSource = msItems; dataGridView1.Columns[0].Visible = false; step = 0; itemId = -1; invId = -1; idx = -1; cart = new List<string>(); grand = 0; }
public ViewItem() { InitializeComponent(); db = new DataClasses1DataContext(); var msItems = from x in db.MsItems select new { x.Id, x.Code, x.Name, x.Category, x.Description }; dataGridView1.DataSource = msItems; dataGridView1.Columns[0].Visible = false; itemId = -1; enableComponents(false); }
public InventoryDetailForm() { InitializeComponent(); db = new DataClasses1DataContext(); refreshTable(); }
public CreateReceiptForm() { InitializeComponent(); showComponents(false); db = new DataClasses1DataContext(); }
public Form1() { InitializeComponent(); db = new DataClasses1DataContext(); }