本文整理汇总了C#中Supplier类的典型用法代码示例。如果您正苦于以下问题:C# Supplier类的具体用法?C# Supplier怎么用?C# Supplier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Supplier类属于命名空间,在下文中一共展示了Supplier类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Button1_Click
protected void Button1_Click(object sender, EventArgs e)
{
if ((Convert.ToInt32(Request.QueryString["id"])) > 0)
{
Supplier s1 = new Supplier();
s1.Name = TextBox1.Text;
s1.Phone = TextBox8.Text;
s1.Email = TextBox2.Text;
s1.ContactPerson = TextBox3.Text;
s1.SupplierID = Convert.ToInt32(Request.QueryString["id"]);
SupplierLogic sl = new SupplierLogic();
sl.Update(s1);
Response.Redirect("SupplierList.aspx");
}
else
{
Supplier s1 = new Supplier();
s1.Name = TextBox1.Text;
s1.Phone = TextBox8.Text;
s1.Email = TextBox2.Text;
s1.ContactPerson = TextBox3.Text;
SupplierLogic sl = new SupplierLogic();
sl.Insert(s1);
Response.Redirect("SupplierList.aspx");
}
}
开发者ID:paulomi-mahidharia,项目名称:OfficeAutomationAndProductionPlanningApplication,代码行数:29,代码来源:EditSupplier.aspx.cs
示例2: GetUpdateDMSDTO
public static supplierDto GetUpdateDMSDTO(Supplier supplier)
{
supplierDto dto = new supplierDto();
dto.suptCode = supplier.Code;
dto.suptName = supplier.Name;
dto.supShortName = supplier.ShortName;
if (supplier.ContactObjectKey != null)
{
if (supplier.ContactObject.PersonName != null)
{
dto.linkMan = supplier.ContactObject.PersonName.DisplayName;
}
dto.phone = supplier.ContactObject.DefaultPhoneNum;
dto.fax = supplier.ContactObject.DefaultFaxNum;
if (supplier.ContactObject.DefaultLocation != null && supplier.ContactObject.DefaultLocation.PostalCode != null)
{
dto.zipCode = supplier.ContactObject.DefaultLocation.PostalCode.PostalCode;
}
if (supplier.ContactObject.DefaultLocation != null)
{
dto.address = supplier.ContactObject.DefaultLocation.Address1;
}
}
dto.actionType = 2;
// status 100201 有效 100202 无效
dto.status = (supplier.Effective != null && supplier.Effective.IsEffective) ? "100201" : "100202";
return dto;
}
示例3: GetSuppliersByPOType
public static DataTable GetSuppliersByPOType(int poTypeID)
{
var supplier = new Supplier();
string query = HCMIS.Repository.Queries.Supplier.SelectSuppliersByPOType(poTypeID);
supplier.LoadFromRawSql(query);
return supplier.DataTable;
}
示例4: Create
internal Supplier Create(string name, string note, SupplierType type)
{
Supplier supplier = new Supplier(name, note, type, dataAccessFacade);
suppliers.Add(supplier);
return supplier;
}
示例5: DeleteSupplier
//Method to delete the supplier from supplier table by passing all values of supplier details
public static bool DeleteSupplier(Supplier supplier)
{
SqlConnection connection = TravelExpertsDB.GetConnection();
string deleteStatement = "DELETE FROM Suppliers " +
"WHERE SupplierId = @SupplierId AND SupName = @SupName";
SqlCommand deleteCommand = new SqlCommand(deleteStatement, connection);
deleteCommand.Parameters.AddWithValue("@SupplierId", supplier.SupplierId);
deleteCommand.Parameters.AddWithValue("@SupName", supplier.SupName);
try
{
connection.Open();
int count = deleteCommand.ExecuteNonQuery();
if (count > 0)
return true;
else
return false;
}
catch (SqlException ex)
{
throw ex;
}
finally
{
connection.Close();
}
}
示例6: GetDirectVendorSuppliers
public static DataTable GetDirectVendorSuppliers()
{
var supp = new Supplier();
string query = HCMIS.Repository.Queries.Supplier.SelectDirectDeliverySuppliers();
supp.LoadFromRawSql(query);
return supp.DataTable;
}
示例7: Insert
///<summary>Inserts one Supplier into the database. Returns the new priKey.</summary>
internal static long Insert(Supplier supplier)
{
if(DataConnection.DBtype==DatabaseType.Oracle) {
supplier.SupplierNum=DbHelper.GetNextOracleKey("supplier","SupplierNum");
int loopcount=0;
while(loopcount<100){
try {
return Insert(supplier,true);
}
catch(Oracle.DataAccess.Client.OracleException ex){
if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){
supplier.SupplierNum++;
loopcount++;
}
else{
throw ex;
}
}
}
throw new ApplicationException("Insert failed. Could not generate primary key.");
}
else {
return Insert(supplier,false);
}
}
示例8: CreatePersistedSupplier
private Supplier CreatePersistedSupplier(string supplierName) {
Supplier supplier = new Supplier(supplierName);
supplierRepository.SaveOrUpdate(supplier);
FlushSessionAndEvict(supplier);
return supplier;
}
示例9: findSupplier
public List<Supplier> findSupplier(string supId)
{
SupplierEnt supEnt = new SupplierEnt();
Supplier sup = new Supplier();
sup.Supplier_ID = supId;
return supEnt.getSupplier(sup);
}
示例10: updateObject
public void updateObject(DataContext db, Supplier objIn)
{
throwExceptionIfInvilid(objIn);
objIn.EntityKey = db.Suppliers.Where(o => o.id == objIn.id).Single().EntityKey;
db.Suppliers.ApplyCurrentValues(objIn);
}
示例11: Should_update_an_existing_lot
public async Task Should_update_an_existing_lot()
{
using (var store = NewDocumentStore())
{
using (var session = store.OpenAsyncSession())
{
var supplier = new Supplier {Id = "Suppliers-1"};
await SaveEntity(supplier, session);
var lot = new Lot {Id = "lots/2015/3", Arrived = new DateTime(2015, 6, 5)};
await SaveEntity(lot, session);
}
using (var session = store.OpenAsyncSession())
{
var lotDto = new LotDto {Id = "lots/2015/3", Arrived = new DateTime(2015, 6, 5), SupplierId = "Suppliers-1"};
var service = GetLotItemsService(session);
await service.Save(lotDto);
}
using (var session = store.OpenAsyncSession())
{
var service = GetLotItemsService(session);
var actual = await service.GetLotById("lots/2015/3");
actual.SupplierId.Should().Be("Suppliers-1");
}
}
}
示例12: OnSelectedSupplier
protected void OnSelectedSupplier(object sender, SelectedSupplierEventArgs e)
{
supplier = e.Supplier;
if (SelectedSupplier != null)
SelectedSupplier(sender, e);
}
示例13: Insert
public ActionResult Insert(Supplier model)
{
try
{
//var f = Request.Files["uplLogo"];
//if (f != null && f.ContentLength > 0)
//{
// model.Logo = model.Id
// + f.FileName.Substring(f.FileName.LastIndexOf("."));
// f.SaveAs(Server.MapPath("~/images/suppliers/" + model.Logo));
//}
//var from = Server.MapPath("/photos/"+model.Logo);
//model.Logo = model.Id + model.Logo.Substring(model.Logo.LastIndexOf("."));
//var to = Server.MapPath("/Content/img/suppliers/" + model.Logo);
//System.IO.File.Move(from, to);
db.Suppliers.Add(model);
db.SaveChanges();
ModelState.AddModelError("", "Inserted");
}
catch
{
ModelState.AddModelError("", "Error");
}
ViewBag.Suppliers = db.Suppliers;
return View("Index", model);
}
示例14: Create
public ActionResult Create(Supplier supplier)
{
if (ModelState.IsValid)
{
try
{
try
{
_supplierService.CreateSupplier(supplier);
this.ShowMessage("Supplier created successfully", MessageType.Success);
return RedirectToAction("Index");
}
catch (Exception ex)
{
this.ShowMessage("Error on data generation with the following details " + ex.Message, MessageType.Error);
}
}
catch (Exception ex)
{
this.ShowMessage("Error on data generation with the following details " + ex.Message, MessageType.Error);
}
}
return View(supplier);
}
示例15: Create
public ActionResult Create(Supplier item)
{
if (!ModelState.IsValid)
return PartialView ("_Create", item);
using (var scope = new TransactionScope ()) {
item.CreateAndFlush ();
}
return PartialView ("_CreateSuccesful", item);
//if (!ModelState.IsValid)
//{
// if (Request.IsAjaxRequest())
// return PartialView("_Create", supplier);
// return View(supplier);
//}
//supplier.Create ();
//if (Request.IsAjaxRequest())
//{
// //FIXME: localize string
// return PartialView("_Success", "Operation successful!");
//}
//return View("Index");
}