示例#1
0
        public static bool Create(GroupModel groupModel)
        {
            using (var client = new LandauPortalWebAPI())
            {
                var groupOrder = new GroupOrder();

                //Group
                groupOrder.Brand = groupModel.Brand;
                //Group Inquiry
                setInquiry(groupOrder, groupModel);
                //Group Purchase
                setPurchase(groupOrder, groupModel);
                //Group Necessity
                setNecessity(groupOrder, groupModel);
                //Group
                groupOrder.Comments  = groupModel.Comments;
                groupOrder.EntryDate = DateTime.Now;

                try
                {
                    String result = client.GroupOrders.Create(groupOrder.Brand, groupOrder);
                    return(true);
                }
                catch (Exception e)
                {
                    if (e is HttpOperationException)
                    {
                        var httpEx = (HttpOperationException)e;
                        return(httpEx.Response.IsSuccessStatusCode);
                    }
                }
                return(false);
            }
        }
示例#2
0
        public void UpdateBtnGroupClickDateTime(int GroupOrderID, DateTime btnGroupClickDateTime)
        {
            GroupOrder groupOrder = groupOrder_repo.SearchGroupOrder(GroupOrderID);

            groupOrder.BtnGroupClickDateTime = btnGroupClickDateTime;
            groupOrder_repo.UpdateGroupOrder(groupOrder);
        }
示例#3
0
        private static void setPurchase(GroupOrder groupOrder, GroupModel groupModel)
        {
            //Group Purchase (not required)
            if (groupModel.Purchase.AreYouSellingToOther != null)
            {
                groupOrder.AreYouSellingToOther = groupModel.Purchase.AreYouSellingToOther;
            }

            groupOrder.AreYouTheDecisionMaker = groupModel.Purchase.AreYouTheDecisionMaker;

            if (groupModel.Purchase.IfNotDecisionMakerWhoIs != null)
            {
                groupOrder.IfNotDecisionMakerWhoIs = groupModel.Purchase.IfNotDecisionMakerWhoIs;
            }

            if (groupModel.Purchase.NumberOfOutfitted != null)
            {
                groupOrder.NumberOfOutfitted = groupModel.Purchase.NumberOfOutfitted;
            }

            groupOrder.WhoWillWearPatientCare = groupModel.Purchase.WhoWillWearPatientCare;
            groupOrder.WhoWillWearNonMedical  = groupModel.Purchase.WhoWillWearNonMedical;

            if (groupModel.Purchase.WhichAreYouSeekingToOutfit != null)
            {
                groupOrder.WhichAreYouSeekingToOutfit = groupModel.Purchase.WhichAreYouSeekingToOutfit;
            }
        }
示例#4
0
        public void UpdateShipDateTime(int GroupOrderID, DateTime shipDateTime)
        {
            GroupOrder groupOrder = groupOrder_repo.SearchGroupOrder(GroupOrderID);

            groupOrder.shipDateTime = shipDateTime;
            groupOrder_repo.UpdateGroupOrder(groupOrder);
        }
示例#5
0
 /// <param name='operations'>
 /// Reference to the ZtherApiIntegration.API.IGroupOrders.
 /// </param>
 /// <param name='brand'>
 /// Required.
 /// </param>
 /// <param name='model'>
 /// Required.
 /// </param>
 public static string Create(this IGroupOrders operations, string brand, GroupOrder model)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IGroupOrders)s).CreateAsync(brand, model);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
示例#6
0
 public void UpdateGroupOrder(GroupOrder groupOrder)
 {
     using (conn = new SqlConnection(connectionString))
     {
         string sql = "UPDATE GroupOrder  SET isGroup = @isGroup, NumberOfProduct = @NumberOfProduct, Amount = @Amount, shipDateTime = @shipDateTime, BtnOrderClickDateTime = @BtnOrderClickDateTime, BtnGroupClickDateTime = @BtnGroupClickDateTime Where GroupOrderID = @GroupOrderID";
         conn.Execute(sql, new { groupOrder.isGroup, groupOrder.NumberOfProduct, groupOrder.Amount, groupOrder.shipDateTime, groupOrder.BtnOrderClickDateTime, groupOrder.BtnGroupClickDateTime, groupOrder.GroupOrderID });
     }
 }
示例#7
0
        /// <summary>
        /// Creates a new Excel file.
        /// </summary>
        /// <param name="path">Defines the path to where the file should be placed</param>
        public void CreateNewExcel(string path)
        {
            _examinedGroup     = new ExaminedGroup();
            _order             = new Order();
            _groupOrder        = new GroupOrder();
            _resources         = new Resources();
            _rTranslation      = new ResourceTranslation();
            _uiDesign          = new ECktUIDesign();
            _qaGroups          = new ECQAGroups();
            _qAktUiDesign      = new ECQAktUIDesign();
            _resourceType      = new ResourceType();
            _pageType          = new ECktUIPageType();
            _fieldIncludedType = new ECktUIFieldIncludedType();

            try
            {
                // Create a spreadsheet document by supplying the filepath.
                // By default, AutoSave = true, Editable = true, and Type = xlsx.
                SpreadsheetDocument spreadsheetDocument =
                    SpreadsheetDocument.Create(path, SpreadsheetDocumentType.Workbook);

                // Add a WorkbookPart to the document.
                WorkbookPart workbookpart = spreadsheetDocument.AddWorkbookPart();
                workbookpart.Workbook = new Workbook();

                // Add Sheets to the Workbook.
                Sheets sheets = spreadsheetDocument.WorkbookPart.Workbook.
                                AppendChild(new Sheets());

                //Add sheets to the Workbook
                _examinedGroup.CreateSheet(sheets, spreadsheetDocument, workbookpart);
                _order.CreateSheet(sheets, spreadsheetDocument, workbookpart);

                _groupOrder.CreateSheet(sheets, spreadsheetDocument, workbookpart);
                _resources.CreateSheet(sheets, spreadsheetDocument, workbookpart);
                _rTranslation.CreateSheet(sheets, spreadsheetDocument, workbookpart);
                _uiDesign.CreateSheet(sheets, spreadsheetDocument, workbookpart);
                _qaGroups.CreateSheet(sheets, spreadsheetDocument, workbookpart);
                _qAktUiDesign.CreateSheet(sheets, spreadsheetDocument, workbookpart);
                _resourceType.CreateSheet(sheets, spreadsheetDocument, workbookpart);
                _pageType.CreateSheet(sheets, spreadsheetDocument, workbookpart);
                _fieldIncludedType.CreateSheet(sheets, spreadsheetDocument, workbookpart);



                workbookpart.Workbook.Save();

                // Close the document.
                spreadsheetDocument.Close();

                _wvm._changedFlag = false;
            }
            catch (Exception e)
            {
                // Maybe save exception in a log file
                MessageBox.Show(e.Message);
            }
        }
示例#8
0
 public GroupOrder SearchGroupOrder(int groupOrderId)
 {
     using (conn = new SqlConnection(connectionString))
     {
         string     sql        = "SELECT * FROM GroupOrder WHERE GroupOrderID = @GroupOrderID";
         GroupOrder GroupOrder = conn.QueryFirstOrDefault <GroupOrder>(sql,
                                                                       new { GroupOrderID = groupOrderId });
         return(GroupOrder);
     }
 }
示例#9
0
 private static void setNecessity(GroupOrder groupOrder, GroupModel groupModel)
 {
     //Group Necessity
     groupOrder.NeedScrubs      = groupModel.Necessity.NeedScrubs;
     groupOrder.NeedLabCoats    = groupModel.Necessity.NeedLabCoats;
     groupOrder.NeedPrintedTops = groupModel.Necessity.NeedPrintedTops;
     groupOrder.NeedEmbroidery  = groupModel.Necessity.NeedEmbroidery;
     groupOrder.NeedNonMedical  = groupModel.Necessity.NeedNonMedical;
     groupOrder.NeedCustomized  = groupModel.Necessity.NeedCustomized;
 }
示例#10
0
        public override string ToString()
        {
            var json = new StringBuilder();

            json.Append("groupingView : {");
            if (GroupField.IsEmpty())
            {
                throw new ArgumentException("必须为分组设置至少一个列名!");
            }
            json.AppendFormat("groupField:{0},", GroupField.ToJson());
            if (!GroupOrder.IsEmpty())
            {
                json.AppendFormat("groupOrder:{0},", GroupOrder.ToJson());
            }
            if (!GroupText.IsEmpty())
            {
                json.AppendFormat("groupText:{0},", GroupText.ToJson());
            }
            if (!GroupColumnShow.IsEmpty())
            {
                json.AppendFormat("groupColumnShow:{0},", GroupColumnShow.ToJson());
            }
            if (!GroupSummary.IsEmpty())
            {
                json.AppendFormat("groupSummary:{0},", GroupSummary.ToJson());
            }
            if (HideFirstGroupCol)
            {
                json.Append("groupSummary:true,");
            }
            if (ShowSummaryOnHide)
            {
                json.Append("showSummaryOnHide:true,");
            }
            if (!Plusicon.IsEmpty())
            {
                json.AppendFormat("plusicon:'{0}',", Plusicon);
            }
            if (!Minusicon.IsEmpty())
            {
                json.AppendFormat("minusicon:'{0}',", Minusicon);
            }
            if (!IsInTheSameGroup.IsEmpty())
            {
                json.AppendFormat("isInTheSameGroup:{0},", Regex.Replace(IsInTheSameGroup.ToJson(), "'\"", ""));
            }
            if (!FormatDisplayField.IsEmpty())
            {
                json.AppendFormat("formatDisplayField:{0},", Regex.Replace(FormatDisplayField.ToJson(), "'\"", ""));
            }

            json.Append("}");
            return(json.ToString());
        }
 public static List<IFilter> GetTreeFilters(this TokenStore store)
 {
     var filters = store.FilterRegistrations
                        .Select(x => x.GetFilter()).ToList();
     var groupOrder = new GroupOrder(filters);
     return filters
         .OrderByDescending(x => x.FilterInfo.Priority)
         .ThenByDescending(x => groupOrder.GetGroupOrder(x))
         .ThenBy(x => x.FilterInfo.Id)
         .ToList();
 }
示例#12
0
        public static List <IFilter> GetTreeFilters(this TokenStore store)
        {
            var filters = store.FilterRegistrations
                          .Select(x => x.GetFilter()).ToList();
            var groupOrder = new GroupOrder(filters);

            return(filters
                   .OrderByDescending(x => x.FilterInfo.Priority)
                   .ThenByDescending(x => groupOrder.GetGroupOrder(x))
                   .ThenBy(x => x.FilterInfo.Id)
                   .ToList());
        }
示例#13
0
        public ArrangeGraphsGroupedDlg(int countGraphs)
        {
            InitializeComponent();

            _countGraphs = countGraphs;

            textGroups.Text = Groups.ToString(LocalizationHelper.CurrentCulture);
            if (GroupType == GroupGraphsType.distributed)
            {
                radioDistribute.Checked = true;
            }
            comboSortOrder.SelectedItem  = GroupOrder.GetLocalizedString();
            comboBoxDisplay.SelectedItem = DisplayType.GetLocalizedString();
            cbReversed.Checked           = Settings.Default.ArrangeGraphsReversed;
        }
示例#14
0
 public bool UpdateGroupOrder(int GroupOrderID, int NumberOfProduct, decimal Amount, bool isGroup)
 {
     try
     {
         GroupOrder groupOrder = groupOrder_repo.SearchGroupOrder(GroupOrderID);
         groupOrder.NumberOfProduct = NumberOfProduct;
         groupOrder.Amount          = Amount;
         groupOrder.isGroup         = isGroup;
         groupOrder_repo.UpdateGroupOrder(groupOrder);
         return(true);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         return(false);
     }
 }
示例#15
0
        private static void setInquiry(GroupOrder groupOrder, GroupModel groupModel)
        {
            //Group Inquiry (required)
            groupOrder.FirstName   = groupModel.Inquiry.FirstName;
            groupOrder.LastName    = groupModel.Inquiry.LastName;
            groupOrder.CompanyName = groupModel.Inquiry.CompanyName;

            var industry = groupModel.Inquiry.IndustryList.Where(i => i.Name == groupModel.Inquiry.Industry.Name).FirstOrDefault();

            if (industry != null)
            {
                groupOrder.Industry = new Industry()
                {
                    Name = industry.Name, ID = industry.ID
                }
            }
            ;

            //Group Inquiry Address
            groupOrder.Address         = new Address();
            groupOrder.Address.Street1 = groupModel.Inquiry.Address.Street1;
            if (groupModel.Inquiry.Address.Street2 != null) // (not required)
            {
                groupOrder.Address.Street2 = groupModel.Inquiry.Address.Street2;
            }
            groupOrder.Address.City    = groupModel.Inquiry.Address.City;
            groupOrder.Address.State   = groupModel.Inquiry.Address.State;
            groupOrder.Address.Zipcode = groupModel.Inquiry.Address.Zipcode;
            //Group Inquiry
            groupOrder.Phone = groupModel.Inquiry.Phone;
            if (groupModel.Inquiry.Cell != null) // (not required)
            {
                groupOrder.Cell = groupModel.Inquiry.Cell;
            }
            groupOrder.Email = groupModel.Inquiry.Email;
            if (groupModel.Inquiry.Web != null) // (not required)
            {
                groupOrder.Web = groupModel.Inquiry.Web;
            }
        }
示例#16
0
        /// <param name='brand'>
        /// Required.
        /// </param>
        /// <param name='id'>
        /// Required.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        public async Task <HttpOperationResponse <GroupOrder> > GetGroupOrderByIdWithOperationResponseAsync(string brand, int id, CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            // Validate
            if (brand == null)
            {
                throw new ArgumentNullException("brand");
            }

            // Tracing
            bool   shouldTrace  = ServiceClientTracing.IsEnabled;
            string invocationId = null;

            if (shouldTrace)
            {
                invocationId = ServiceClientTracing.NextInvocationId.ToString();
                Dictionary <string, object> tracingParameters = new Dictionary <string, object>();
                tracingParameters.Add("brand", brand);
                tracingParameters.Add("id", id);
                ServiceClientTracing.Enter(invocationId, this, "GetGroupOrderByIdAsync", tracingParameters);
            }

            // Construct URL
            string url = "";

            url = url + "/brands/";
            url = url + Uri.EscapeDataString(brand);
            url = url + "/grouporders/";
            url = url + Uri.EscapeDataString(id.ToString());
            string baseUrl = this.Client.BaseUri.AbsoluteUri;

            // Trim '/' character from the end of baseUrl and beginning of url.
            if (baseUrl[baseUrl.Length - 1] == '/')
            {
                baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
            }
            if (url[0] == '/')
            {
                url = url.Substring(1);
            }
            url = baseUrl + "/" + url;
            url = url.Replace(" ", "%20");

            // Create HTTP transport objects
            HttpRequestMessage httpRequest = new HttpRequestMessage();

            httpRequest.Method     = HttpMethod.Get;
            httpRequest.RequestUri = new Uri(url);

            // Set Credentials
            if (this.Client.Credentials != null)
            {
                cancellationToken.ThrowIfCancellationRequested();
                await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false);
            }

            // Send Request
            if (shouldTrace)
            {
                ServiceClientTracing.SendRequest(invocationId, httpRequest);
            }
            cancellationToken.ThrowIfCancellationRequested();
            HttpResponseMessage httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);

            if (shouldTrace)
            {
                ServiceClientTracing.ReceiveResponse(invocationId, httpResponse);
            }
            HttpStatusCode statusCode = httpResponse.StatusCode;

            cancellationToken.ThrowIfCancellationRequested();
            string responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);

            if (statusCode != HttpStatusCode.OK)
            {
                HttpOperationException <object> ex = new HttpOperationException <object>();
                ex.Request  = httpRequest;
                ex.Response = httpResponse;
                ex.Body     = null;
                if (shouldTrace)
                {
                    ServiceClientTracing.Error(invocationId, ex);
                }
                throw ex;
            }

            // Create Result
            HttpOperationResponse <GroupOrder> result = new HttpOperationResponse <GroupOrder>();

            result.Request  = httpRequest;
            result.Response = httpResponse;

            // Deserialize Response
            if (statusCode == HttpStatusCode.OK)
            {
                GroupOrder resultModel = new GroupOrder();
                JToken     responseDoc = null;
                if (string.IsNullOrEmpty(responseContent) == false)
                {
                    responseDoc = JToken.Parse(responseContent);
                }
                if (responseDoc != null)
                {
                    resultModel.DeserializeJson(responseDoc);
                }
                result.Body = resultModel;
            }

            if (shouldTrace)
            {
                ServiceClientTracing.Exit(invocationId, result);
            }
            return(result);
        }
示例#17
0
        /// <param name='operations'>
        /// Reference to the ZtherApiIntegration.API.IGroupOrders.
        /// </param>
        /// <param name='brand'>
        /// Required.
        /// </param>
        /// <param name='model'>
        /// Required.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        public static async Task <string> CreateAsync(this IGroupOrders operations, string brand, GroupOrder model, CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Microsoft.Rest.HttpOperationResponse <string> result = await operations.CreateWithOperationResponseAsync(brand, model, cancellationToken).ConfigureAwait(false);

            return(result.Body);
        }