本文整理汇总了C#中Supplier类的典型用法代码示例。如果您正苦于以下问题:C# Supplier类的具体用法?C# Supplier怎么用?C# Supplier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Supplier类属于命名空间,在下文中一共展示了Supplier类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:HaiBoHan,项目名称:HBHDaYunsy,代码行数:28,代码来源:SupplierUpdated.cs
示例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;
}
开发者ID:USAID-DELIVER-PROJECT,项目名称:ethiopia-hcmis-warehouse,代码行数:7,代码来源:Supplier.cs
示例4: Create
internal Supplier Create(string name, string note, SupplierType type)
{
Supplier supplier = new Supplier(name, note, type, dataAccessFacade);
suppliers.Add(supplier);
return supplier;
}
开发者ID:Klockz,项目名称:LonelyTreeExam,代码行数:7,代码来源:SupplierCollection.cs
示例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();
}
}
开发者ID:dwija256,项目名称:OOSD2015Phase2,代码行数:30,代码来源:SupplierDB.cs
示例6: GetDirectVendorSuppliers
public static DataTable GetDirectVendorSuppliers()
{
var supp = new Supplier();
string query = HCMIS.Repository.Queries.Supplier.SelectDirectDeliverySuppliers();
supp.LoadFromRawSql(query);
return supp.DataTable;
}
开发者ID:USAID-DELIVER-PROJECT,项目名称:ethiopia-hcmis-warehouse,代码行数:7,代码来源:Supplier.cs
示例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);
}
}
开发者ID:nampn,项目名称:ODental,代码行数:26,代码来源:SupplierCrud.cs
示例8: CreatePersistedSupplier
private Supplier CreatePersistedSupplier(string supplierName) {
Supplier supplier = new Supplier(supplierName);
supplierRepository.SaveOrUpdate(supplier);
FlushSessionAndEvict(supplier);
return supplier;
}
开发者ID:EdisonCP,项目名称:sharp-architecture,代码行数:7,代码来源:SupplierRepositoryBehaviorTests.cs
示例9: findSupplier
public List<Supplier> findSupplier(string supId)
{
SupplierEnt supEnt = new SupplierEnt();
Supplier sup = new Supplier();
sup.Supplier_ID = supId;
return supEnt.getSupplier(sup);
}
开发者ID:kaungmyat,项目名称:university_stationary,代码行数:7,代码来源:UpdateSuppliers.cs
示例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);
}
开发者ID:TheinHtikeAung,项目名称:Stationery-Store-Inventory-System,代码行数:7,代码来源:SupplierFacade.cs
示例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");
}
}
}
开发者ID:jeremy-holt,项目名称:Cornhouse.Factory-Mutran,代码行数:30,代码来源:_Save.cs
示例12: OnSelectedSupplier
protected void OnSelectedSupplier(object sender, SelectedSupplierEventArgs e)
{
supplier = e.Supplier;
if (SelectedSupplier != null)
SelectedSupplier(sender, e);
}
开发者ID:sidneylimafilho,项目名称:InfoControl,代码行数:7,代码来源:SelectSupplier.ascx.cs
示例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);
}
开发者ID:tsaodemt,项目名称:MultiShop,代码行数:29,代码来源:SupplierController.cs
示例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);
}
开发者ID:raselbappigit,项目名称:properties-management,代码行数:25,代码来源:SupplierController.cs
示例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");
}
开发者ID:mictlanix,项目名称:mbe,代码行数:29,代码来源:SuppliersController.cs
示例16: Given_valid_request_When_create_supplier_Then_should_call_correct_methods
public void Given_valid_request_When_create_supplier_Then_should_call_correct_methods()
{
// Given
var target = CreateRolesService();
var request = new SaveSupplierRequest()
{
UserId = Guid.NewGuid(),
Name = "New Supplier",
CompanyId = 2
};
var user = new UserForAuditing();
_usersRepository
.Setup(s => s.GetByIdAndCompanyId(request.UserId, request.CompanyId))
.Returns(user);
// When
var supplierPassedToRepositoryForSave = new Supplier();
_suppliersRepository.Setup(x => x.SaveOrUpdate(It.IsAny<Supplier>()))
.Callback<Supplier>(y => supplierPassedToRepositoryForSave = y);
target.CreateSupplier(request);
// Then
_suppliersRepository.VerifyAll();
Assert.That(supplierPassedToRepositoryForSave.CompanyId, Is.EqualTo(request.CompanyId));
Assert.That(supplierPassedToRepositoryForSave.Name, Is.EqualTo(request.Name));
}
开发者ID:mnasif786,项目名称:Business-Safe,代码行数:30,代码来源:CreateSupplierTests.cs
示例17: AddSupplier
//Method to add the supplier to the supplier table
public static void AddSupplier(Supplier supplier)
{
SqlConnection connection = TravelExpertsDB.GetConnection();
string insertStatement = "INSERT Suppliers (SupplierId, SupName) VALUES (@SupplierId, @SupName)";
SqlCommand insertCommand = new SqlCommand(insertStatement, connection);
insertCommand.Parameters.AddWithValue("@SupplierId", supplier.SupplierId);
insertCommand.Parameters.AddWithValue("@SupName",supplier.SupName);
try
{
connection.Open();
insertCommand.ExecuteNonQuery();
//string selectStatement = "SELECT IDENT_CURRENT('Suppliers') from Suppliers";
//SqlCommand selectCommand = new SqlCommand(selectStatement, connection);
//int supplierId = Convert.ToInt32(selectCommand.ExecuteScalar());
//return supplierId;
}
catch (SqlException ex)
{
throw ex;
}
finally
{
connection.Close();
}
}
开发者ID:dwija256,项目名称:OOSD2015Phase2,代码行数:26,代码来源:SupplierDB.cs
示例18: FrmAddSupplier
/// <summary>
/// Form Constructor
/// </summary>
/// <param name="businessArg"></param>
public FrmAddSupplier(Business businessArg)
{
InitializeComponent();
business = businessArg;
newSupplier = new Supplier();
updatedSupplier = new Supplier();
}
开发者ID:pauloaguiar91,项目名称:SalesApplication,代码行数:11,代码来源:FrmAddSupplier.cs
示例19: GetAllSuppliersFor
/// <summary>
/// Gets all suppliers for.
/// </summary>
/// <param name="ItemID">The item ID.</param>
/// <param name="unitID">The unit ID.</param>
/// <returns></returns>
public static DataTable GetAllSuppliersFor(int ItemID,int unitID)
{
Supplier supp = new Supplier();
string query = HCMIS.Repository.Queries.Supplier.SelectGetAllSuppliersFor(ItemID, unitID);
supp.LoadFromRawSql(query);
return supp.DataTable;
}
开发者ID:USAID-DELIVER-PROJECT,项目名称:ethiopia-hcmis-warehouse,代码行数:13,代码来源:Supplier.cs
示例20: Home
public ActionResult Home()
{
#region Prep Utilities
myHandler = new BusinessLogicHandler();
Supplier supplier = new Supplier();
RangeViewModel model = new RangeViewModel();
#endregion
#region Get User(Supplier)
string userName = User.Identity.GetUserName();
ApplicationDbContext dataSocket = new ApplicationDbContext();
UserStore<ApplicationUser> myStore = new UserStore<ApplicationUser>(dataSocket);
_userManager = new ApplicationUserManager(myStore);
var user = _userManager.FindByEmail(userName);
#endregion
#region Get Supplier Details
supplier = myHandler.GetSupplier(user.Id);
#endregion
#region Get Orders For Supplier
model.Orders = myHandler.GetSupplierOrders(supplier.SupplierID);
if(model.Orders != null)
{ model.Orders.OrderBy(m => m.DateCreated); }
#endregion
return View(model);
}
开发者ID:Gcobani,项目名称:urbanbooks,代码行数:35,代码来源:SupplierController.cs
注:本文中的Supplier类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论