private void Loadsubsupplier(Model.Supplier supplier, IList <SubSupplier> lstDeputy = null) { if (m_Suplier == null) { return; } if (lstDeputy == null) { using (IUnitOfWork uow = new UnitOfWork()) { lstDeputy = uow.SubSupplierRepository.GetbySupplier(supplier); uow.Commit(); } } gridUtility1.BindingData <SubSupplier>(lstDeputy); if (lstDeputy != null) { m_Subsupplier = lstDeputy.Where(p => p.IsMain == true).FirstOrDefault(); if (m_Subsupplier == null) { m_Subsupplier = new SubSupplier(); } InitializeForm(m_Subsupplier); } //cbbIsMainDeputy.Checked = deputy.IsMain; }
private void btnCreate_Click(object sender, EventArgs e) { if (ValidationUtility.FieldNotAllowNull(txtsupplierCode) == false) { lblNotify1.SetText(UI.hasnoinfomation, LabelNotify.EnumStatus.Failed); return; } m_Suplier = new Model.Supplier(); CoverObjectUtility.GetAutoBindingData(this, m_Suplier); m_Suplier.ApproveStatusId = (int)ApproveStatus.Wait; m_Suplier.SetCreate(); m_Suplier.SupplierId = 0; try { var count = 0; using (IUnitOfWork uow = new UnitOfWork()) { count = uow.SupplierRepository.CheckExitSuplier(m_Suplier); } if (count > 0) { lblNotify1.SetText(UI.CompanyisExists, ToolBoxCS.LabelNotify.EnumStatus.Failed); return; } SaveSupplier(m_Suplier); lblNotify1.SetText(UI.success, ToolBoxCS.LabelNotify.EnumStatus.Success); AddNode(m_Suplier); } catch { lblNotify1.SetText(UI.failed, ToolBoxCS.LabelNotify.EnumStatus.Failed); } }
private void SelectDisplayNode(TreeNode node) { if (node == null) { return; } if (node.Nodes.Count > 1) { return; } TreeTagGroupSupplier treetag = node.Tag as TreeTagGroupSupplier; if (treetag == null) { return; } IList <SubSupplier> lstDeputy = null; using (IUnitOfWork uow = new UnitOfWork()) { m_Suplier = uow.SupplierRepository.FindByGroupSupplierID(treetag.GroupId); if (m_Suplier != null) { lstDeputy = uow.SubSupplierRepository.GetbySupplier(m_Suplier); } uow.Commit(); } InitializeForm(m_Suplier); Loadsubsupplier(m_Suplier, lstDeputy); }
public void Delete(Model.Supplier supplier) { // // todo:add other logic here // accessor.Delete(supplier.SupplierId); }
public ROSupplier(Model.Supplier supplier) : this() { this.lblCompanyName.Text = BL.Settings.CompanyChineseName; this.lblReportName.Text = "供應商基本資料"; this.lblSupplierCategory.Text = supplier.SupplierCategory == null ? "" : supplier.SupplierCategory.SupplierCategoryName; this.lblSupplierId.Text = supplier.Id; this.lblSupplierFullName.Text = supplier.SupplierFullName; this.lblSupplierShortName.Text = supplier.SupplierShortName; this.lblAreaCategory.Text = supplier.AreaCategory == null ? "" : supplier.AreaCategory.AreaCategoryName; this.lblSupplierNumber.Text = supplier.SupplierNumber; this.lblSupplierManager.Text = supplier.SupplierManager; this.lblSupplierContact.Text = supplier.SupplierContact; this.lblSupplierMobile.Text = supplier.SupplierMobile; this.lblSupplierPhone1.Text = supplier.SupplierPhone1; this.lblSupplierPhone2.Text = supplier.SupplierPhone2; this.lblSupplierFax.Text = supplier.SupplierFax; this.lblPostCode.Text = supplier.PostCode; this.lblSupplierEmail.Text = supplier.Email; this.lblCompanyAddress.Text = supplier.CompanyAddress; this.lblFactoryAddress.Text = supplier.FactoryAddress; this.lblPayAddress.Text = supplier.PayAddress; this.lblPayMethod.Text = supplier.PayMethod == null ? "" : supplier.PayMethod.PayMethodName; this.lblPayDay.Text = supplier.PayDay.HasValue ? supplier.PayDay.Value.ToString() : ""; this.lblAdvancePatment.Text = supplier.AdvancePatment.HasValue ? supplier.AdvancePatment.Value.ToString() : ""; this.lblNetAddress.Text = supplier.NetAddress; this.lblNoId.Text = supplier.NoId; this.lblSupplierRemark.Text = supplier.SupplierRemark; }
/// <summary> /// 自定义列显示 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gridView1_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e) { if (e.ListSourceRowIndex < 0) { return; } IList <Model.ProductEpiboly> details = this.bindingSource1.DataSource as IList <Model.ProductEpiboly>; if (details == null || details.Count < 1) { return; } Model.Product product = details[e.ListSourceRowIndex].Product; Model.Supplier supplier = details[e.ListSourceRowIndex].Supplier; if (product == null || supplier == null) { return; } switch (e.Column.Name) { case "ProductId": e.DisplayText = product.Id; break; case "SupplierId": e.DisplayText = supplier.Id; break; } }
public string GetSubjectNameBySupplier(Model.Supplier supplier) { Dictionary <string, string> dic = new Dictionary <string, string>(); dic["原料"] = "原料"; dic["物料"] = "物料"; dic["代工 加工"] = "代工加工"; dic["代工加工"] = "代工加工"; dic["修繕"] = "修繕"; dic["客供品"] = "客供品"; dic["文具"] = "文具用品"; dic["清潔用品"] = "清潔"; dic["運費"] = "運費"; dic["其他"] = "其他"; if (supplier.SupplierCategory == null) { throw new Exception("該供應商沒有設置供應商分類,無法計算對應的會計科目!"); } if (dic.Keys.Contains(supplier.SupplierCategory.SupplierCategoryName)) { return(dic[supplier.SupplierCategory.SupplierCategoryName]); } else { return(supplier.SupplierCategory.SupplierCategoryName); } }
//更换供应商 private void newChooseContorlSupplierId_EditValueChanged(object sender, EventArgs e) { if (this.newChooseContorlSupplierId.EditValue != null) { Model.Supplier sup = this.newChooseContorlSupplierId.EditValue as Model.Supplier; this.calcAdvancePaymentBalance.Text = sup.PayableOwe == null ? "0" : sup.PayableOwe.Value.ToString(); } }
protected override bool HasRows() { Model.Supplier _inSup = this.bsSupplier.Current as Model.Supplier; //Model.ProcessCategory _inProc = this.bsProcessCategory.Current as Model.ProcessCategory; //return this._SupplierProcesscategoryManager.mHasRows(_inSup.SupplierId); return(true); }
//选择供应商改变 private void bsSupplier_CurrentChanged(object sender, EventArgs e) { this._CurrentSupplier = this.bsSupplier.Current as Model.Supplier; this._SupProList = this._SupplierProductManager.mSelect(this._CurrentSupplier.SupplierId); this.bsSupplierProduct.DataSource = _SupProList; this.grdConSupProduct.RefreshDataSource(); }
public bool ExistsExcept(Model.Supplier e) { Hashtable paras = new Hashtable(); paras.Add("newId", e.Id); paras.Add("oldId", Get(e.SupplierId).Id); return(sqlmapper.QueryForObject <bool>("Supplier.existsexcept", paras)); }
public IList <Model.InvoiceCO> SelectbySupplierAndinvoiceId(Model.Supplier supplier, string invoiceId) { Hashtable ht = new Hashtable(); ht.Add("supperId", supplier == null ? null : supplier.SupplierId); ht.Add("invoiceId", invoiceId == "" ? null : invoiceId); return(sqlmapper.QueryForList <Model.InvoiceCO>("InvoiceCO.selectbySupplierAndinvoiceId", ht)); }
public void AddNode(Model.Supplier supplierAdd) { TreeNode treenode = currentNode; if (treenode == null) { return; } TreeTagGroupSupplier treetag = treenode.Tag as TreeTagGroupSupplier; TreeTagGroupSupplier tree = new TreeTagGroupSupplier { ParrentId = treetag.ParrentId, GroupId = treetag.GroupId }; TreeNode treenodeparrent = new TreeNode(); if (treetag.ParrentId == 0) { tree.ParrentId = treetag.GroupId; treenodeparrent = treenode; } else { tree.ParrentId = treetag.ParrentId; treenodeparrent = treenode.Parent; } try { GroupSupplier group = new GroupSupplier { GroupName = supplierAdd.SupplierName, ParentGroup = tree.ParrentId }; using (IUnitOfWork uow = new UnitOfWork()) { group.GroupId = supplierAdd.GroupId = uow.SupplierRepository.AddGroup(group); uow.SupplierRepository.Update(supplierAdd); uow.Commit(); } TreeNode treenodeinsert = new TreeNode(); TreeTagGroupSupplier treetaginsert = new TreeTagGroupSupplier { ParrentId = group.ParentGroup, GroupId = group.GroupId }; treenodeinsert.Tag = treetaginsert; treenodeinsert.Text = supplierAdd.SupplierName; treenodeparrent.Nodes.Add(treenodeinsert); treeviewsupplier.SelectedNode = treenodeinsert; currentNode = treeviewsupplier.SelectedNode; FormatTreeView(supplierAdd); treeviewsupplier.Refresh(); } catch (Exception) { return; } }
/// <summary> /// Update a Supplier. /// </summary> public void Update(Model.Supplier supplier) { // // todo: add other logic here. // Validate(supplier); if (this.ExistsExcept(supplier)) { throw new Helper.InvalidValueException(Model.Supplier.PROPERTY_ID); } try { V.BeginTransaction(); if (supplier.AreaCategory != null) { supplier.AreaCategoryId = supplier.AreaCategory.AreaCategoryId; } if (supplier.TradeCategory != null) { supplier.TradeCategoryId = supplier.TradeCategory.TradeCategoryId; } if (supplier.SupplierCategory != null) { supplier.SupplierCategoryId = supplier.SupplierCategory.SupplierCategoryId; } supplier.EmployeeChangeId = V.ActiveOperator.OperatorName; supplier.UpdateTime = DateTime.Now; accessor.Update(supplier); //删除供应商联系人 supplierContactAccessor.Delete(supplier); //新增供应商联系人 foreach (Model.SupplierContact contact in supplier.Contacts) { contact.Supplier = supplier; contact.SupplierId = supplier.SupplierId; if (string.IsNullOrEmpty(contact.SupplierContactId)) { contact.SupplierContactId = Guid.NewGuid().ToString(); } supplierContactAccessor.Insert(contact); } V.CommitTransaction(); } catch { V.RollbackTransaction(); throw; } }
protected override void MoveLast() { Model.Supplier _inSup = this.bsSupplier.Current as Model.Supplier; //Model.ProcessCategory _inProc = this.bsProcessCategory.Current as Model.ProcessCategory; //Model.SupplierProcesscategory _inSPC = this._SupplierProcesscategoryManager.mGetLast(_inSup.SupplierId); //this._SupplierProcesscategory = _inSPC == null ? null : this._SupplierProcesscategoryManager.Get(_inSPC.SupplierProcesscategoryId); }
/// <summary> /// Select by primary key. /// </summary> public Model.Supplier Get(string supplierId) { Model.Supplier supplier = accessor.Get(supplierId); if (supplier != null) { supplier.Contacts = supplierContactAccessor.Select(supplier); } return(supplier); }
public void Add2Test() { var supplier = new Model.Supplier(); RepositoryRegistry.Supplier.Add(supplier); var result = RepositoryRegistry.Supplier.FindBy(supplier.Id); Assert.AreEqual(supplier.Id, result.Id); }
public static void UpdateSupplier(Model.Supplier supplier) { string query = "BEGIN " + "supplier_pkg.update_supplier(" + supplier.Id + ", '" + supplier.Name + "', '" + supplier.Contact_No + "', '" + supplier.Email + "', '" + supplier.Address + "', '" + supplier.Date_Added.ToString(string.Format("dd/MMM/yyyy")) + "', '" + supplier.Description + "'); " + "END;"; DB_Handler.ExecuteQuery(query); }
public Model.Supplier GetSupplier(HttpContext context) { Model.Supplier s = new Model.Supplier(); if (context.Request["action"] == "add") { s.CreateDate = DateTime.Now; s.CreateUser = (context.Session["login"] as Model.BaseUser).UserName; } else { s.ID = long.Parse(context.Request.Form["hdID"]); s.Code = context.Request.Form["hdCode"].Trim(); s.UpdateDate = DateTime.Now; s.UpdateUser = (context.Session["login"] as Model.BaseUser).UserName; } if (!string.IsNullOrWhiteSpace(context.Request.Form["Margin"])) { s.Margin = decimal.Parse(context.Request.Form["Margin"]); } if (!string.IsNullOrWhiteSpace(context.Request.Form["TaxRate"])) { s.TaxRate = decimal.Parse(context.Request.Form["TaxRate"]); } s.TypeID = context.Request.Form["TypeID"].Trim(); s.Enabled = context.Request.Form["Enabled"] == null ? true : false; s.Abbreviation = context.Request.Form["Abbreviation"].Trim(); s.Address = context.Request.Form["Address"].Trim(); s.AirTransportation = context.Request.Form["AirTransportation"].Trim(); s.BankAccount = context.Request.Form["BankAccount"].Trim(); s.Buyer = context.Request.Form["Buyer"].Trim(); s.Currency = context.Request.Form["Currency"].Trim(); s.DepositBank = context.Request.Form["DepositBank"].Trim(); s.EnAbbreviation = context.Request.Form["EnAbbreviation"].Trim(); s.EnAddress = context.Request.Form["EnAddress"].Trim(); s.EnFullName = context.Request.Form["EnFullName"].Trim(); s.FullName = context.Request.Form["FullName"].Trim(); s.LandTransportation = context.Request.Form["LandTransportation"].Trim(); s.Linkman = context.Request.Form["Linkman"].Trim(); s.OtherTransportation = context.Request.Form["OtherTransportation"].Trim(); s.PaymentMethod = context.Request.Form["PaymentMethod"].Trim(); s.PaymentTerms = context.Request.Form["PaymentTerms"].Trim(); s.PCProject = context.Request.Form["PCProject"].Trim(); s.POSubject = context.Request.Form["POSubject"].Trim(); s.Principal = context.Request.Form["Principal"].Trim(); s.PSubject = context.Request.Form["PSubject"].Trim(); s.PurchasingCycle = context.Request.Form["PurchasingCycle"].Trim(); s.PurchasingCycleTable = context.Request.Form["PurchasingCycleTable"].Trim(); s.PurchasingGoodsCycle = context.Request.Form["PurchasingGoodsCycle"].Trim(); s.Remark = context.Request.Form["Remark"].Trim(); s.SeaTransportation = context.Request.Form["SeaTransportation"].Trim(); s.TCProject = context.Request.Form["TCProject"].Trim(); s.TSubject = context.Request.Form["TSubject"].Trim(); s.TypeCode = context.Request.Form["TypeCode"].Trim(); s.ZipCode = context.Request.Form["ZipCode"].Trim(); return(s); }
public void MyClick(ref ChooseItem item) { ChooseSupplierForm f = new ChooseSupplierForm(); if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Model.Supplier supplier = f.SelectedItem as Model.Supplier; item = new ChooseItem(supplier, supplier.Id, supplier.SupplierShortName); } }
protected override void MovePrev() { Model.Supplier _supplier = this.supplierManager.GetPrev(this._supplier); if (_supplier == null) { throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows); } this._supplier = _supplier; }
private void fillMonths(ref Model.Supplier supplier) { supplier.MonthsDtos = new List <MonthsDto>() { new MonthsDto() { NUMERO_MES = 1, MES = "Enero" }, new MonthsDto() { NUMERO_MES = 2, MES = "Febrero" }, new MonthsDto() { NUMERO_MES = 3, MES = "Marzo" }, new MonthsDto() { NUMERO_MES = 4, MES = "Avril" }, new MonthsDto() { NUMERO_MES = 5, MES = "Mayo" }, new MonthsDto() { NUMERO_MES = 6, MES = "Junio" }, new MonthsDto() { NUMERO_MES = 7, MES = "Julio" }, new MonthsDto() { NUMERO_MES = 8, MES = "Agosto" }, new MonthsDto() { NUMERO_MES = 9, MES = "Septiembre" }, new MonthsDto() { NUMERO_MES = 10, MES = "Octubre" }, new MonthsDto() { NUMERO_MES = 11, MES = "Noviembre" }, new MonthsDto() { NUMERO_MES = 12, MES = "Diciembre" } }; }
private void Validate(Model.Supplier supplier) { if (string.IsNullOrEmpty(supplier.Id)) { throw new Helper.RequireValueException(Model.Supplier.PROPERTY_ID); } if (string.IsNullOrEmpty(supplier.SupplierFullName)) { throw new Helper.RequireValueException(Model.Supplier.PROPERTY_SUPPLIERFULLNAME); } }
private void simpleButton1_Click(object sender, EventArgs e) { this._supplier = buttonEditSupplier.EditValue as Model.Supplier; if (_supplier != null) { this.DialogResult = DialogResult.OK; } else { MessageBox.Show(Properties.Resources.ChooseSupplier, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// 选择供应商编号结束区间 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonEditSupplierEnd_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { Invoices.ChooseSupplier f = new Book.UI.Invoices.ChooseSupplier(); if (f.ShowDialog(this) == DialogResult.OK) { Model.Supplier supplier = f.SelectedItem as Model.Supplier; if (supplier != null) { this.buttonEditSupplierEnd.Text = supplier.Id; } } }
public IList <Book.Model.InvoiceCG> Select(string costartid, string coendid, Model.Supplier SupplierStart, Model.Supplier SupplierEnd, DateTime dateStart, DateTime dateEnd, Model.Product productStart, Model.Product productEnd, string cusxoid, DateTime dateJHStart, DateTime dateJHEnd, string InvoiceCGIdStart, string InvoiceCGIdEnd) { StringBuilder sql = new StringBuilder(); sql.Append(" where invoicedate between '" + dateStart.ToString("yyyy-MM-dd") + "' and '" + dateEnd.ToString("yyyy-MM-dd HH:mm:ss") + "'"); if (SupplierStart != null && SupplierEnd != null) { sql.Append(" and supplierId in(select supplierId from supplier where id between '" + SupplierStart.Id + "' and '" + SupplierEnd.Id + "')"); } if (productStart != null && productEnd != null) { sql.Append(" and invoiceid in (select invoiceid from invoicecgdetail where productid in (select productid from product where ProductName between '" + productStart.ProductName + "' and '" + productEnd.ProductName + "'))"); } if (!string.IsNullOrEmpty(cusxoid)) { sql.Append(" and invoiceid in (select invoiceid from invoicecgdetail where invoicecoid in(select invoiceid from invoiceco where InvoiceCustomXOId like '%" + cusxoid + "%')) "); } if (!string.IsNullOrEmpty(costartid) && !string.IsNullOrEmpty(coendid)) { sql.Append(" and invoiceid in (select invoiceid from invoicecgdetail where invoicecoid between '" + costartid + "' and '" + coendid + "')"); } //if (dateJHStart != null && dateJHEnd != null) if (dateJHStart.Year > Helper.DateTimeParse.NullDate.Year && dateJHEnd.Year < Helper.DateTimeParse.EndDate.Year) { sql.Append(" and invoiceid in (select invoiceid from invoicecgdetail where invoicecoid in(select invoiceid from invoiceco where InvoiceYjrq between '" + dateJHStart.ToString("yyyy-MM-dd") + "' and '" + dateJHEnd.ToString("yyyy-MM-dd HH:mm:ss") + "'))"); } if (!string.IsNullOrEmpty(InvoiceCGIdStart) || !string.IsNullOrEmpty(InvoiceCGIdEnd)) { if (!string.IsNullOrEmpty(InvoiceCGIdStart) && !string.IsNullOrEmpty(InvoiceCGIdEnd)) { sql.Append(" and InvoiceId BETWEEN '" + InvoiceCGIdStart + "' AND '" + InvoiceCGIdEnd + "'"); } else { sql.Append(" and InvoiceId = '" + (string.IsNullOrEmpty(InvoiceCGIdStart) ? InvoiceCGIdEnd : InvoiceCGIdStart) + "'"); } } sql.Append(" order by InvoiceId desc"); //Hashtable ht = new Hashtable(); //ht.Add("SupplierStart", SupplierStart == null ? null : SupplierStart.Id); //ht.Add("SupplierEnd", SupplierEnd == null ? null : SupplierEnd.Id); //ht.Add("dateStart", dateStart); //ht.Add("dateEnd", dateEnd); //ht.Add("productStart", productStart == null ? null : productStart.ProductName); //ht.Add("productEnd", productEnd == null ? null : productEnd.ProductName); //ht.Add("cusxoid", string.IsNullOrEmpty(cusxoid) ? null : cusxoid); //ht.Add("dateJHStart", dateJHStart); //ht.Add("dateJHEnd", dateJHEnd); //ht.Add("costartid", costartid); //ht.Add("coendid", coendid); return(sqlmapper.QueryForList <Book.Model.InvoiceCG>("InvoiceCG.select_sql", sql.ToString())); }
private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) { this._CurrentSupplier = this.bsSupplier.Current as Model.Supplier; this._SupProList = this._SupplierProductManager.mSelect(this._CurrentSupplier.SupplierId); this.bsSupplierProduct.DataSource = _SupProList; if (this.bsSupplierProduct.Count > 0) { this._SupplierProduct = this.bsSupplierProduct.Current as Model.SupplierProduct; } this.grdConSupProduct.RefreshDataSource(); this.Refresh(); }
/// <summary> /// 绑定供应商详细信息 /// </summary> /// <param name="id"></param> void BindDetail(int id) { model = bll.GetModel(id); txtAddress.Text = model.Addressinfo; txtEmail.Text = model.Email; txtExplain.Text = model.Explain; txtNameInfo.Text = model.NameInfo; txtPhone.Text = model.Phone; txtQQ.Text = model.QQNum; txtSortNum.Text = model.SortNum.ToString(); txtTitle.Text = model.CompanyName; txtWechat.Text = model.WeChat; }
/// <summary> /// 提交 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnOK_Click(object sender, EventArgs e) { bool isEdit = false; if (int.TryParse(Request.Params["id"], out id)) { model = bll.GetModel(id); isEdit = true; } else { model.NumId = bll.SetNumID(); model.AddTime = DateTime.Now; } model.Addressinfo = txtAddress.Text; model.CompanyName = txtTitle.Text; model.Email = txtEmail.Text; model.Explain = txtExplain.Text; model.NameInfo = txtNameInfo.Text; model.Phone = txtPhone.Text; model.QQNum = txtQQ.Text; model.SortNum = int.Parse(txtSortNum.Text); model.StateInfo = ckState.Checked ? 1 : 0; model.Tel = ""; model.TypeId = int.Parse(ddlType.SelectedValue); model.WeChat = txtWechat.Text; if (isEdit) { if (bll.Update(model)) { JsMessage("供应商信息修改成功", 2000, "true", "index.aspx" + Request.Url.Query); } else { JsMessage("供应商信息修改失败,请稍候重试", 2000, "false"); } } else { if (bll.Add(model) > 0) { JsMessage("供应商录入成功", 2000, "true", "index.aspx"); } else { JsMessage("供应商信息录入失败,请稍候重试", 2000, "false"); } } }
public static Model.Supplier RowToEntity(DataRow row) { Model.Supplier supplier = new Model.Supplier { Id = Int32.Parse(row["Id"].ToString()), Name = row["Name"].ToString(), Contact_No = row["Contact_No"].ToString(), Email = row["Email"].ToString(), Address = row["Address"].ToString(), Date_Added = Convert.ToDateTime(row["Date_Added"]), Description = row["Description"].ToString() }; return(supplier); }
private void btnAdd_Click(object sender, EventArgs e) { Model.Supplier supplier = new Model.Supplier() { Email = txtEmail.Text, Phone = txtPhone.Text, SupplierName = txtName.Text, IsDeleted = false }; db.Suppliers.Add(supplier); db.SaveChanges(); MessageBox.Show("Save Data Successfully", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); }
public Model.Supplier RecordSupplier(int id) { try { DataTable dt; dt = new DataTable(); dt = this.db.execQuery("Sp_SupplierSelById", new object[] { id }); Model.Supplier supp = new Model.Supplier(); if (dt.Rows.Count > 0) { supp.supplier_id = Convert.ToInt16(dt.Rows[0]["supplier_id"].ToString()); supp.supplier_name = dt.Rows[0]["supplier_name"].ToString(); supp.address = dt.Rows[0]["address"].ToString(); supp.email = dt.Rows[0]["email"].ToString(); supp.phone = dt.Rows[0]["phone"].ToString(); } return supp; } catch (Exception ex) { throw ex; } }
public static Model.Supplier Create(BusinessTime businessTime = null, Coordinates coordinates = null, DeliveryTime[] deliverytime = null) { var supplier = new Model.Supplier() { Name = "好美味餐厅", Address = "北京朝阳区三间房", Tel = "18500191543", BusinessTime = businessTime, Coordinates = coordinates, DeliveryTime = deliverytime, }; return supplier; }