public void SaveSupplierBrand(SupplierBrandResource.SupplierBrand s) { int active = 0; if (s.Active) { active = 1; } client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); client.SQSAdmin_StudioM_AddEditSupplierBrand(s.SupplierBrandID, s.SupplierBrandName, s.BrandStateID, active, CommonVariables.UserCode); client.Close(); }
public void LoadSupplierBrand(string brandname, int pstateid, int active) { SupplierBrandResource.SupplierBrand s; SQSSupplierBrand.Clear(); client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); DataSet ds = client.SQSAdmin_StudioM_GetSupplierBrand(brandname, pstateid, active); client.Close(); foreach (DataRow dr in ds.Tables[0].Rows) { s = new SupplierBrandResource.SupplierBrand(); s.SupplierBrandID = int.Parse(dr["id_studiom_supplierbrand"].ToString()); s.SupplierBrandName = dr["supplierbrandname"].ToString(); s.Active = bool.Parse(dr["active"].ToString()); s.BrandStateID = int.Parse(dr["fkidstate"].ToString()); s.BrandStateName = dr["stateAbbreviation"].ToString(); SQSSupplierBrand.Add(s); } }