public void GetProductImage(string productid, int supplierid) { StudioMProductImage.Clear(); BitmapImage bi; client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); DataSet ds = client.SQSAdmin_StudioM_GetProductImages(productid, supplierid); client.Close(); foreach (DataRow dr in ds.Tables[0].Rows) { ProductImage b = new ProductImage(); b.ImageID = int.Parse(dr["id_StudioM_ProductImage"].ToString()); b.ImageName = dr["imagename"].ToString(); b.SupplierBrandName = dr["supplierbrandname"].ToString(); b.ImageStream = (byte[])dr["image"]; bi = new BitmapImage(); bi.BeginInit(); bi.StreamSource = new MemoryStream(ResizeImages((byte[])dr["image"], ThumbnailWidth, ThumbnailHeight)); bi.EndInit(); b.BMPImage = bi; StudioMProductImage.Add(b); } }
public void LoadExistingAreasForProduct(string productid, int active) { CommonResource.Area s; ExistingAreas.Clear(); ExcludedAreas.Clear(); client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); DataSet ds = client.SQSAdmin_RelatedArea_LoadExistingAreasForProduct(productid, active); client.Close(); foreach (DataRow dr in ds.Tables[0].Rows) { s = new CommonResource.Area(); if (dr["validateinstudiom"] != null && (dr["validateinstudiom"].ToString() == "1" || dr["validateinstudiom"].ToString().ToUpper() == "TRUE")) { s.AreaID = int.Parse(dr["areaid"].ToString()); s.AreaName = dr["areaname"].ToString(); ExistingAreas.Add(s); } else { s.AreaID = int.Parse(dr["areaid"].ToString()); s.AreaName = dr["areaname"].ToString(); ExcludedAreas.Add(s); } } }
public void LoadBrand(int stateid) { SQSBrand.Clear(); SQSBrandWithAll.Clear(); ItemsBrand = new Dictionary <string, object>(); SelectedItemsBrand = new Dictionary <string, object>(); Brand b = new Brand(); b.BrandID = 0; b.BrandName = "All"; SQSBrandWithAll.Add(b); client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); DataSet ds = client.SQSAdmin_Generic_GetBrandByState(stateid); client.Close(); foreach (DataRow dr in ds.Tables[0].Rows) { b = new Brand(); b.BrandID = int.Parse(dr["brandid"].ToString()); b.BrandName = dr["brandname"].ToString(); SQSBrand.Add(b); SQSBrandWithAll.Add(b); ItemsBrand.Add(b.BrandName, b.BrandID); } }
public void SaveRelatedAreaToProduct(string productid, string areaidstring, string usercode, string callfrom) { client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); client.SQSAdmin_RelatedArea_AddSelectedAreasToProduct(productid, areaidstring, usercode, callfrom); client.Close(); }
public void RemoveMinimumAreasToHome(int homeid, string selectedareaid, string usercode) { client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); client.SQSAdmin_Generic_RemoveMinimumAreasFromHome(homeid, selectedareaid, usercode); client.Close(); }
public void LoadAnswerForQuestions(int questionid) { StudioMAnswer.Clear(); client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); DataSet ds = client.SQSAdmin_StudioM_GetAnswerForQuestion(questionid); client.Close(); foreach (DataRow dr in ds.Tables[0].Rows) { StudioMResource.Answer a = new StudioMResource.Answer(); a.AnswerID = int.Parse(dr["idtemplateanswer"].ToString()); a.AnswerText = dr["answer"].ToString(); bool exists = false; foreach (StudioMResource.Answer prod in SelectedAnswer) { if (a.AnswerID == prod.AnswerID) { exists = true; break; } } if (!exists) { StudioMAnswer.Add(a); } } }
public void CopyMinimumAreasFromSourceToTargetHomes(string sourcehomeid, string targethomeidstring, string usercode) { client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); client.SQSAdmin_HomeMinimumArea_CopyMinimumAreasFromSourceHomeToTargetHome(sourcehomeid, targethomeidstring, usercode); client.Close(); }
public void RemoveRelatedAreaFromProduct(string productid, string areaidstring, string callfrom) { client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); client.SQSAdmin_RelatedArea_RemooveSelectedAreasFromProduct(productid, areaidstring, callfrom); client.Close(); }
public void LoadAnswer(string questiontext, string answertext, int active, int pstateid) { Answer s; StudioMAnswer.Clear(); client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); DataSet ds = client.SQSAdmin_StudioM_GetAnswerList(questiontext, answertext, active, pstateid); client.Close(); foreach (DataRow dr in ds.Tables[0].Rows) { s = new Answer(); s.AnswerID = int.Parse(dr["idtemplateanswer"].ToString()); s.AnswerText = dr["answer"].ToString(); s.QuestionID = int.Parse(dr["fkidtemplatequestion"].ToString()); s.QuestionText = dr["question"].ToString(); s.AnswerTypeText = dr["answertype"].ToString(); s.Active = bool.Parse(dr["active"].ToString()); StudioMAnswer.Add(s); } LoadQuestions("", 1, pstateid); }
public void RemoveStandardInclusion(StandardInclusionResource.StandardInclusionPAG s) { client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); client.SQSAdmin_StandardInclusion_RemoveStandardInclusion(s.StandardInclusionID); client.Close(); }
public void SaveStandardInclusionToBrand(string selectedids, string brandids, int regiongroupid, string usercode, DateTime effectivedate) { client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); client.SQSAdmin_StandardInclusion_SaveStandardInclusionToBrand(selectedids, brandids, regiongroupid, usercode, effectivedate); client.Close(); }
public void LoadRegionGroupFromState(int pstateid, bool includeRegional = false) { client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); DataSet ds = client.SQSAdmin_StandardInclusion_GetRegionGroupByState(pstateid); client.Close(); SQSRegionGroup.Clear(); SQSRegionGroupWithAll.Clear(); RegionGroup rg = null; if (pstateid == 1) { rg = new RegionGroup(); rg.RegionGroupID = 0; rg.RegionGroupName = "All Regions"; SQSRegionGroupWithAll.Add(rg); } foreach (DataRow dr in ds.Tables[0].Rows) { rg = new RegionGroup(); rg.RegionGroupID = int.Parse(dr["idregiongroup"].ToString()); rg.RegionGroupName = dr["regiongroupname"].ToString(); SQSRegionGroup.Add(rg); SQSRegionGroupWithAll.Add(rg); } if (pstateid == 1 && includeRegional) { rg = new RegionGroup(); rg.RegionGroupID = 12; rg.RegionGroupName = "Regional"; SQSRegionGroupWithAll.Insert(2, rg); } }
public void LoadQuestion(int stateid, string searchtext) { StudioMQuestion.Clear(); client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); DataSet ds = client.SQSAdmin_StudioM_SearchActiveQuestions(stateid, searchtext); client.Close(); foreach (DataRow dr in ds.Tables[0].Rows) { StudioMResource.Question b = new StudioMResource.Question(); b.QuestionID = int.Parse(dr["idtemplatequestion"].ToString()); b.QuestionText = dr["question"].ToString(); b.AnswerTypeID = int.Parse(dr["fkidanswertype"].ToString()); b.AnswerType = dr["answertype"].ToString(); b.QuestionAndType = dr["questionandtype"].ToString(); b.Mandatory = bool.Parse(dr["mandatory"].ToString()); bool exists = false; foreach (StudioMResource.Question prod in SelectedQuestion) { if (b.QuestionID == prod.QuestionID) { exists = true; break; } } if (!exists) { StudioMQuestion.Add(b); } } }
public void SaveValidationRule(string standardinclusionproductid, string upgradeoptionproductids, string brandids, string usercode, bool promotion, DateTime effectivedate) { client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); client.SQSAdmin_StandardInclusion_SaveValidationRule(standardinclusionproductid, upgradeoptionproductids, brandids, usercode, promotion, effectivedate); client.Close(); }
//public void LoadPAGsFromProduct(string productid) //{ // client = new SQSAdminServiceClient(); // client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); // DataSet ds= client.SQSAdmin_StandardInclusion_GetPAGFromProduct(productid); // client.Close(); // SQSProductAreaGroup.Clear(); // ProductAreaGroup pg = new ProductAreaGroup(); // pg.ProductAreaGroupID = 0; // pg.ProductAreaGroupName = "Please Select..."; // SQSProductAreaGroup.Add(pg); // foreach (DataRow dr in ds.Tables[0].Rows) // { // pg = new ProductAreaGroup(); // pg.ProductAreaGroupID = int.Parse(dr["productareagroupid"].ToString()); // pg.ProductAreaGroupName = dr["productareagroupid"].ToString(); // SQSProductAreaGroup.Add(pg); // } //} public void LoadAvailableStandardInclusionPAGsFromMasterList(string productid, string productname, int areaid, int groupid, int stateid) { DateTime dateSelected = (DateTime)System.Data.SqlTypes.SqlDateTime.MinValue; client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); DataSet ds = client.SQSAdmin_StandardInclusion_GetAvailableStandardInclusionPAGFromMasterList(areaid, groupid, productid, productname, stateid); client.Close(); SQSProductAreaGroup.Clear(); ProductAreaGroup pg; if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { pg = new ProductAreaGroup(); pg.ProductAreaGroupID = int.Parse(dr["productareagroupid"].ToString()); pg.AreaID = int.Parse(dr["areaid"].ToString()); pg.GroupID = int.Parse(dr["groupid"].ToString()); pg.AreaName = dr["areaname"].ToString(); pg.GroupName = dr["groupname"].ToString(); pg.ProductID = dr["productid"].ToString(); pg.ProductName = dr["productname"].ToString(); pg.ProductDescription = dr["productdescription"].ToString(); pg.ProductIDName = dr["productid"].ToString() + " - " + dr["productname"].ToString(); SQSProductAreaGroup.Add(pg); } } }
public void LoadQAndA(string id, string type) { StudioMResource.QandAForSupplier qa; StudioMQandA.Clear(); client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); DataSet ds = client.SQSAdmin_StudioM_LoadStudioMAttributeForClusterOrGroup(id, type, DefaultStateID.ToString()); client.Close(); foreach (DataRow dr in ds.Tables[0].Rows) { qa = new StudioMResource.QandAForSupplier(); qa.SupplierBrandID = int.Parse(dr["idStudioMSupplier"].ToString()); qa.SupplierBrandName = dr["SupplierName"].ToString(); qa.QuestionID = int.Parse(dr["idTemplateQuestion"].ToString()); qa.QuestionText = dr["Question"].ToString(); if (bool.Parse(dr["mandatory"].ToString())) { qa.Mandatory = true; } else { qa.Mandatory = false; } qa.AnswerType = dr["AnswerType"].ToString(); qa.AnswerID = int.Parse(dr["idTemplateAnswer"].ToString()); qa.AnswerText = dr["Answer"].ToString(); StudioMQandA.Add(qa); } }
public void RemoveSelectedGroupFromRetailCluster(int retailclusterid, string selectedgroupuid) { client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); client.SQSAdmin_StudioM_RemoveSelectedGroupFromRetailCluster(retailclusterid, selectedgroupuid); client.Close(); }
private void Window_Unloaded(object sender, RoutedEventArgs e) { if (client != null && client.State == System.ServiceModel.CommunicationState.Opened) { client.Close(); } }
public void LoadSuppliers(int stateid, string suppliername, int active) { int tempsize; StudioMSupplier.Clear(); _tempsupplier.Clear(); client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); DataSet ds = client.SQSAdmin_StudioM_GetSuppliers(stateid, suppliername, active); client.Close(); foreach (DataRow dr in ds.Tables[0].Rows) { Supplier b = new Supplier(); b.SupplierID = int.Parse(dr["idstudiomsupplier"].ToString()); b.SupplierName = dr["suppliername"].ToString(); b.Active = bool.Parse(dr["active"].ToString()); b.StateID = int.Parse(dr["fkidstate"].ToString()); b.StateName = dr["statename"].ToString(); StudioMSupplier.Add(b); _tempsupplier.Add(b); } if (ds.Tables[0].Rows.Count > pagesize) { tempsize = pagesize; } else { tempsize = ds.Tables[0].Rows.Count; } StudioMSupplier2 = new PagingCollectionView(_tempsupplier, tempsize); }
public void LoadQuestions(string question, int active, int pstateid) { Question s; StudioMQuestion.Clear(); client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); DataSet ds = client.SQSAdmin_StudioM_GetQuestionList(question, active, pstateid); client.Close(); foreach (DataRow dr in ds.Tables[0].Rows) { s = new Question(); s.QuestionID = int.Parse(dr["idtemplatequestion"].ToString()); s.QuestionText = dr["question"].ToString(); s.AnswerTypeID = int.Parse(dr["fkidanswertype"].ToString()); s.AnswertypeText = dr["answerType"].ToString(); s.Active = bool.Parse(dr["active"].ToString()); s.QuestionAndType = dr["questionandtype"].ToString(); s.QuestionStateID = int.Parse(dr["fkidstate"].ToString()); s.Mandatory = bool.Parse(dr["Mandatory"].ToString()); StudioMQuestion.Add(s); } }
public void RemoveProductImage(int imageid, int supplierid) { client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); client.SQSAdmin_StudioM_RemoveProductImage(imageid); client.Close(); GetProductImage(productid, supplierid); }
private DataSet SearchProductPrice1(int stateid, int regionid, int status, string productid, string productname, string productdesc, int studiomproduct) { client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); DataSet ds = client.SQSAdmin_StudioM_GetProductPrice(stateid, regionid, productid, productname, productdesc, status, studiomproduct); client.Close(); return(ds); }
public bool SupplierBrandExists(string brandname, int pstateid) { bool result; client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); result = client.SQSAdmin_StudioM_CheckSupplierBrandExists(brandname, pstateid); client.Close(); return(result); }
public bool StandardInclusionExists(int pagid, int pbrandid, int pregiongroupid, int standardinclusionid) { bool result; client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); result = client.SQSAdmin_StandardInclusion_IsStandardInclusionExists(pagid, pbrandid, pregiongroupid, standardinclusionid); client.Close(); return(result); }
public bool BulkConfigureStudioMQandA(string supplierbrandid, string productidstring, string questionidstring, string answeridstring, string usercode) { client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); bool result = client.SQSAdmin_StudioM_BulkConfigureStudiomQandA(supplierbrandid, productidstring, questionidstring, answeridstring, usercode); client.Close(); return(result); }
public bool SupplierExists(int pstateid, string suppliername) { bool result; client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); result = client.SQSAdmin_StudioM_IsSupplierExists(pstateid, suppliername); client.Close(); return(result); }
public bool QuestionExists(int panswertypeid, string questiontext) { bool result; client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); result = client.SQSAdmin_StudioM_IsQuestionExists(panswertypeid, questiontext, stateid); client.Close(); return(result); }
public bool AnswerExists(int questionid, string answertext) { bool result; client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); result = client.SQSAdmin_StudioM_IsAnswerExists(questionid, answertext); client.Close(); return(result); }
public void SaveProductImage(string productid, string imagename, int supplierid, byte[] imagestream) { int psupplierid = 0; client = new SQSAdminServiceClient(); client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint); client.SQSAdmin_StudioM_SaveProductImage(productid, imagename, supplierid, imagestream); client.Close(); //if (filter) // psupplierid = supplierid; GetProductImage(productid, psupplierid); }
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(); }