Esempio n. 1
0
 public ctrlIntroduction(int pstateid)
 {
     loginstate = pstateid;
     client     = new SQSAdminServiceClient();
     client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint);
     InitializeComponent();
 }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 5
0
 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();
 }
Esempio n. 6
0
 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();
 }
Esempio n. 7
0
        public void SearchAvailableProducts(int stateid, string productid, string productname)
        {
            client = new SQSAdminServiceClient();
            client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint);
            DataSet ds = client.SQSAdmin_StudioM_GetStudioMProduct(stateid, productid, productname);

            AvailableProduct.Clear();
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                Product p = new Product();
                p.ProductID   = dr["productid"].ToString();
                p.ProductName = dr["productname"].ToString();
                //p.ProductDescription = dr["productdescription"].ToString();
                bool exists = false;
                foreach (Product prod in SelectedProduct)
                {
                    if (p.ProductID == prod.ProductID)
                    {
                        exists = true;
                        break;
                    }
                }
                if (!exists)
                {
                    AvailableProduct.Add(p);
                }
            }
        }
Esempio n. 8
0
 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();
 }
Esempio n. 9
0
        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);
        }
Esempio n. 10
0
        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);
                }
            }
        }
Esempio n. 11
0
 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();
 }
Esempio n. 12
0
 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();
 }
Esempio n. 13
0
        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);
                }
            }
        }
Esempio n. 14
0
 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();
 }
Esempio n. 15
0
        //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);
                }
            }
        }
Esempio n. 16
0
        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);
            }
        }
Esempio n. 17
0
 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();
 }
Esempio n. 18
0
        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);
            }
        }
Esempio n. 19
0
 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();
 }
Esempio n. 20
0
        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);
        }
Esempio n. 21
0
        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);
            }
        }
Esempio n. 22
0
        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            client = new SQSAdminServiceClient();
            client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint);


            client.SQSAdmin_StudioM_UploadImageToSharepointImageLibrary("SG-BRI-CA1-140", 0);
        }
Esempio n. 23
0
 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);
 }
Esempio n. 24
0
        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);
        }
Esempio n. 25
0
        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);
        }
Esempio n. 26
0
        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);
        }
Esempio n. 27
0
        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);
        }
Esempio n. 28
0
        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);
        }
Esempio n. 29
0
        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);
        }
Esempio n. 30
0
        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);
        }