public OrderInWizardForm() { InitializeComponent(); colCowSex.ValueMember = "Key"; colCowSex.DisplayMember = "Value"; colCowSex.DataSource = TypeUtil.CowSex().ToList(); cbxPrename.ValueMember = "Key"; cbxPrename.DisplayMember = "Value"; cbxPrename.DataSource = TypeUtil.Prename().ToList(); cbxOrderType.ValueMember = "Key"; cbxOrderType.DisplayMember = "Value"; cbxOrderType.DataSource = TypeUtil.InOrderTypeWithoutBorn().ToList(); cbxTransportType.ValueMember = "Key"; cbxTransportType.DisplayMember = "Value"; cbxTransportType.DataSource = TypeUtil.InTransportType().ToList(); cbxPaymentStatus.ValueMember = "Key"; cbxPaymentStatus.DisplayMember = "Value"; cbxPaymentStatus.DataSource = TypeUtil.InPaymentStatus().ToList(); cbxPaymentType.ValueMember = "Key"; cbxPaymentType.DisplayMember = "Value"; cbxPaymentType.DataSource = TypeUtil.InPaymentType().ToList(); cbxBankType.ValueMember = "Key"; cbxBankType.DisplayMember = "Value"; cbxBankType.DataSource = TypeUtil.AccountType().ToList(); }
private void CustomerDetailForm_Load(object sender, EventArgs e) { this.cityTableAdapter.Fill(this.farmManageDataSet.City); this.postCodeTableAdapter.Fill(this.farmManageDataSet.PostCode); this.districtTableAdapter.Fill(this.farmManageDataSet.District); this.provinceTableAdapter.Fill(this.farmManageDataSet.Province); cbxPrename.ValueMember = "Key"; cbxPrename.DisplayMember = "Value"; cbxPrename.DataSource = TypeUtil.Prename().ToList(); colOrderInType.ValueMember = "Key"; colOrderInType.DisplayMember = "Value"; colOrderInType.DataSource = TypeUtil.InOrderType().ToList(); colOrderInPaymentStatus.ValueMember = "Key"; colOrderInPaymentStatus.DisplayMember = "Value"; colOrderInPaymentStatus.DataSource = TypeUtil.InPaymentStatus().ToList(); colOrderOutType.ValueMember = "Key"; colOrderOutType.DisplayMember = "Value"; colOrderOutType.DataSource = TypeUtil.OutOrderType().ToList(); colOrderOutPaymentStatus.ValueMember = "Key"; colOrderOutPaymentStatus.DisplayMember = "Value"; colOrderOutPaymentStatus.DataSource = TypeUtil.InPaymentStatus().ToList(); colBankType.ValueMember = "Key"; colBankType.DisplayMember = "Value"; colBankType.DataSource = TypeUtil.AccountType().ToList(); if (!MainForm.User.SuperUser) { tcMain.TabPages.Remove(tabLog); } else { this.userLogUC.FillEvent(TypeUtil.Customer, CustomerPID); } this.orderOutTableAdapter.Fill(this.farmManageDataSet.OrderOut); this.orderInTableAdapter.Fill(this.farmManageDataSet.OrderIn); this.bankAccountTableAdapter.Fill(this.farmManageDataSet.BankAccount); this.usersViewTableAdapter.Fill(this.farmManageDataSet.UsersView); this.userLogTableAdapter.Fill(this.farmManageDataSet.UserLog); this.postCodeTableAdapter.Fill(this.farmManageDataSet.PostCode); this.provinceTableAdapter.Fill(this.farmManageDataSet.Province); this.districtTableAdapter.Fill(this.farmManageDataSet.District); this.cityTableAdapter.Fill(this.farmManageDataSet.City); this.companyTableAdapter.Fill(this.farmManageDataSet.Company); this.customerTableAdapter.FillByPK(this.farmManageDataSet.Customer, CustomerPID); }
private void InOrderForm_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'farmManageDataSet.UsersView' table. You can move, or remove it, as needed. this.usersViewTableAdapter.Fill(this.farmManageDataSet.UsersView); this.cbxPrename.DataSource = TypeUtil.Prename().ToList(); this.cbxOrderType.DataSource = TypeUtil.InOrderType().ToList(); this.cbxBankType.DataSource = TypeUtil.AccountType().ToList(); this.cbxPaymentType.DataSource = TypeUtil.InPaymentType().ToList(); this.cbxPaymentStatus.DataSource = TypeUtil.InPaymentStatus().ToList(); this.cbxTransportType.DataSource = TypeUtil.InTransportType().ToList(); this.colCowSex.ValueMember = "Key"; this.colCowSex.DisplayMember = "Value"; this.colCowSex.DataSource = TypeUtil.CowSex().ToList(); // TODO: This line of code loads data into the 'farmManageDataSet.Customer' table. You can move, or remove it, as needed. this.customerTableAdapter.FillByOrderInID(this.farmManageDataSet.Customer, this.OrderInID); // TODO: This line of code loads data into the 'farmManageDataSet.PostCode' table. You can move, or remove it, as needed. this.postCodeTableAdapter.Fill(this.farmManageDataSet.PostCode); // TODO: This line of code loads data into the 'farmManageDataSet.City' table. You can move, or remove it, as needed. this.cityTableAdapter.Fill(this.farmManageDataSet.City); // TODO: This line of code loads data into the 'farmManageDataSet.District' table. You can move, or remove it, as needed. this.districtTableAdapter.Fill(this.farmManageDataSet.District); // TODO: This line of code loads data into the 'farmManageDataSet.Province' table. You can move, or remove it, as needed. this.provinceTableAdapter.Fill(this.farmManageDataSet.Province); // TODO: This line of code loads data into the 'farmManageDataSet.Company' table. You can move, or remove it, as needed. this.companyTableAdapter.Fill(this.farmManageDataSet.Company); // TODO: This line of code loads data into the 'farmManageDataSet.UsersView' table. You can move, or remove it, as needed. this.usersViewTableAdapter.Fill(this.farmManageDataSet.UsersView); // TODO: This line of code loads data into the 'farmManageDataSet.Province' table. You can move, or remove it, as needed. this.provinceTableAdapter.Fill(this.farmManageDataSet.Province); // TODO: This line of code loads data into the 'farmManageDataSet.BankAccount' table. You can move, or remove it, as needed. this.bankAccountTableAdapter.Fill(this.farmManageDataSet.BankAccount); // TODO: This line of code loads data into the 'farmManageDataSet.Gene' table. You can move, or remove it, as needed. this.geneTableAdapter.Fill(farmManageDataSet.Gene); // TODO: This line of code loads data into the 'farmManageDataSet.Corral' table. You can move, or remove it, as needed. this.corralTableAdapter.Fill(farmManageDataSet.Corral); // TODO: This line of code loads data into the 'farmManageDataSet.Cow' table. You can move, or remove it, as needed. this.cowTableAdapter.Fill(farmManageDataSet.Cow); // TODO: This line of code loads data into the 'farmManageDataSet.OrderIn' table. You can move, or remove it, as needed. this.orderInTableAdapter.FillByPK(farmManageDataSet.OrderIn, OrderInID); if (!MainForm.User.SuperUser) { this.tcMain.TabPages.Remove(this.tabRecord); } else { this.userLogUC.FillEvent(TypeUtil.OrderIn, OrderInID.ToString()); } var CurrentRow = ((orderInBindingSource.Current as DataRowView).Row as FarmManageDataSet.OrderInRow); tbxTotalAmount.Text = (CurrentRow.TransportCost + CurrentRow.Amount).ToString("C2"); switch (CurrentRow.PaymentStatus) { case 0: this.cbxPaymentStatus.Enabled = true; this.btnPrintBill.Enabled = false; break; case 1: this.cbxBankNO.Enabled = false; this.cbxPaymentStatus.Enabled = false; this.dtpPaymentDate.Enabled = false; this.cbxPaymentBy.Enabled = false; this.cbxPaymentType.Enabled = false; this.btnSave.Visible = false; this.btnCancel.Text = "ปิด"; this.btnPrintBill.Enabled = true; break; } switch (CurrentRow.OrderType) { case 0: break; case 1: break; case 2: this.Text = "รายละเอียดการคลอดลูก"; this.lblTitle.Text = "รายละเอียดการคลอดลูก"; this.tabCow.Text = "รายการคลอดลูก"; this.btnSave.Visible = false; this.btnCancel.Text = "ปิด"; this.btnPrintBill.Enabled = true; this.tcMain.TabPages.Remove(tabCustomer); this.gbxPayment.Visible = false; return; } }
private void ReceverBillForm_Load(object sender, EventArgs e) { cowOrderInReportTableAdapter.Fill(reportDataSet.CowOrderInReport); var orderInReportTableAdapter = new OrderInReportTableAdapter(); var orderInData = orderInReportTableAdapter.GetDataByPK(OrderInID); if (orderInData.Count != 0) { var row = orderInData[0]; var ReportParameters = new List <ReportParameter>(); ReportParameters.Add(new ReportParameter("OrderID", row.OrderInID.ToString())); ReportParameters.Add(new ReportParameter("OrderType", TypeUtil.InOrderType()[row.OrderType])); ReportParameters.Add(new ReportParameter("OrderDate", row.OrderDate.ToLocalTime().ToShortDateString())); ReportParameters.Add(new ReportParameter("OrderByName", String.Format("{0} {1}", TypeUtil.Prename()[row.OrderPrename], row.OrderName))); ReportParameters.Add(new ReportParameter("PaymentByName", String.Format("{0} {1}", TypeUtil.Prename()[row.PaymentPrename], row.PaymentName))); ReportParameters.Add(new ReportParameter("TransportCost", row.TransportCost.ToString())); ReportParameters.Add(new ReportParameter("TransportType", TypeUtil.OutTransportType()[row.TransportType])); ReportParameters.Add(new ReportParameter("TransportBillNO", row.TransportBillNO)); ReportParameters.Add(new ReportParameter("TransportBillIssuesBy", row.TransportBillIssuedBy)); ReportParameters.Add(new ReportParameter("CustomerID", row.CustomerID.ToString())); ReportParameters.Add(new ReportParameter("CustomerName", String.Format("{0} {1}", TypeUtil.Prename()[row.CustomerPrename], row.CustomerName))); ReportParameters.Add(new ReportParameter("PaymentByName", String.Format("{0} {1}", TypeUtil.Prename()[row.PaymentPrename], row.PaymentName))); ReportParameters.Add(new ReportParameter("FarmTax", "เลขประจำตัวผู้เสียภาษี :" + Settings.Default.infoTax)); var CustomerAddress = new StringBuilder(); CustomerAddress.Append(row.Address.Trim().Length != 0 ? row.Address.Trim() : string.Empty); CustomerAddress.Append(row.Streed.Trim().Length != 0 ? " ถนน " + row.Streed.Trim() : string.Empty); CustomerAddress.Append(row.City.Trim().Length != 0 ? " ตำบล " + row.City.Trim() : string.Empty); CustomerAddress.Append(row.District.Trim().Length != 0 ? " อำเภอ " + row.District.Trim() : string.Empty); CustomerAddress.Append(row.Province.Trim().Length != 0 ? " จังหวัด " + row.Province.Trim() : string.Empty); CustomerAddress.Append(row.Postcode.Trim().Length != 0 ? " " + row.Postcode.Trim() : string.Empty); ReportParameters.Add(new ReportParameter("CustomerAddress", CustomerAddress.ToString())); var CustomerContact = new StringBuilder(); CustomerContact.Append(row.Tel.Trim().Length != 0 ? String.Format("เบอร์โทร {0} ", row.Tel) : string.Empty); CustomerContact.Append(row.Mobile.Trim().Length != 0 ? "มือถือ " + row.Mobile : string.Empty); ReportParameters.Add(new ReportParameter("CustomerContact", CustomerContact.ToString())); ReportParameters.Add(new ReportParameter("FarmName", Settings.Default.infoCompany.Length == 0 ? Settings.Default.infoFarmName : Settings.Default.infoCompany)); var FarmAddtrss = new StringBuilder(); FarmAddtrss.Append(Settings.Default.infoAddres.Trim().Length != 0 ? Settings.Default.infoAddres.Trim() + " " : string.Empty); FarmAddtrss.Append(Settings.Default.infoCity.Trim().Length != 0 ? String.Format("ตำบล {0} ", Settings.Default.infoCity.Trim()) : string.Empty); FarmAddtrss.Append(Settings.Default.infoDistrict.Trim().Length != 0 ? String.Format("อำเภอ {0} ", Settings.Default.infoDistrict.Trim()) : string.Empty); FarmAddtrss.Append(Settings.Default.infoProvince.Trim().Length != 0 ? String.Format("จังหวัด {0} ", Settings.Default.infoProvince.Trim()) : string.Empty); FarmAddtrss.Append(Settings.Default.infoCountry.Trim().Length != 0 ? Settings.Default.infoCountry.Trim() + " " : string.Empty); FarmAddtrss.Append(Settings.Default.infoPostcode.Trim().Length != 0 ? Settings.Default.infoPostcode.Trim() : string.Empty); ReportParameters.Add(new ReportParameter("FarmAddress", FarmAddtrss.ToString())); var FarmContact = new StringBuilder(); FarmContact.Append(Settings.Default.infoTel.Trim().Length != 0 ? String.Format("เบอร์โทร {0} ", Settings.Default.infoTel.Trim()) : string.Empty); FarmContact.Append(Settings.Default.infoMobile.Trim().Length != 0 ? String.Format("มือถือ {0} ", Settings.Default.infoMobile.Trim()) : string.Empty); FarmContact.Append(Settings.Default.infoFax.Trim().Length != 0 ? String.Format("แฟกซ์ {0} ", Settings.Default.infoFax.Trim()) : string.Empty); ReportParameters.Add(new ReportParameter("FarmContact", FarmContact.ToString())); var FarmInfo = new StringBuilder(); FarmInfo.Append(Settings.Default.infoWebsite.Trim().Length != 0 ? String.Format("เว็บไชต์ {0} ", Settings.Default.infoWebsite.Trim()) : string.Empty); FarmInfo.Append(Settings.Default.infoEmail.Trim().Length != 0 ? "อีเมล์ " + Settings.Default.infoEmail.Trim() : string.Empty); ReportParameters.Add(new ReportParameter("FarmInfo", FarmInfo.ToString())); ReportParameters.Add(new ReportParameter("FarmTax", "เลขประจำตัวผู้เสียภาษี :" + Settings.Default.infoTax)); ReportParameters.Add(new ReportParameter("PaymentStatus", row.PaymentStatus == 1 ? String.Format("{0} โดย {1}", TypeUtil.InPaymentStatus()[row.PaymentStatus], TypeUtil.InPaymentType()[row.PaymentType]) : TypeUtil.InPaymentStatus()[row.PaymentStatus])); if (row.PaymentType == 1) { ReportParameters.Add(new ReportParameter("PaymentDetail", String.Format("ชื่อบัญชี: {0} เลขบัญชี: {1} ประเภท: {2} สาขา: {3} ธนาคาร: {4}", row.BankAccountName, row.BankAccountNO, (row.BankAccountType == 99 ? "-" : TypeUtil.AccountType()[row.BankAccountType]), row.BankAccountBranch, row.BackName))); } reportViewer.LocalReport.SetParameters(ReportParameters); reportViewer.RefreshReport(); } }