public static string SendManDocPack(string login, int password, int moneyType, string money, string center, string vType, string returnDate, bool reception = false) { string requestResult = String.Empty; string servicesList = ManualDocPack.AllServices(); Log.Add("запрос на чек: " + servicesList, freeLine: true); string fields = String.Format( "login={0}&pass={1}&moneytype={2}&money={3}¢er={4}&vtype={5}&rdate={6}&services={7}&callback={8}&r={9}&n=1", login, password, moneyType, money, RCenterNamesExclusion(center), vType, returnDate, servicesList, MainWindow.Cashbox.serialNumber, (reception ? "1" : "0") ); string url = String.Format("/vcs/cashbox_mandocpack.htm?{0}&crc={1}", fields, CheckRequest.CreateMD5(fields, notOrd: true)); Log.Add(url, logType: "http"); try { requestResult = SockectSend(url); } catch (SocketException e) { Log.AddWeb("(отправка запроса на чек) " + e.Message); return("ERROR|Ошибка отправки запроса на чек"); } return(requestResult); }
public static string SendManDocPack(string login, int password, int moneyType, string money, string center, string vType, string returnDate, bool reception = false, bool withoutApp = false) { string requestResult = String.Empty; string servicesList = ManualDocPack.AllServices(); Log.Add("запрос на чек: " + servicesList, freeLine: true); string fields = "login="******"&pass="******"&moneytype=" + moneyType.ToString() + "&money=" + money + "¢er=" + RCenterNamesExclusion(center) + "&vtype=" + vType + "&rdate=" + returnDate + "&services=" + servicesList + "&callback=" + MainWindow.Cashbox.serialNumber + "&r=" + (reception ? "1" : "0") + "&n=" + (withoutApp ? "1" : "0"); string request = fields + "&crc=" + CheckRequest.CreateMD5(fields, notOrd: true); string url = "/vcs/cashbox_mandocpack.htm?" + request; Log.Add(url, logType: "http"); try { requestResult = SockectSend(url); } catch (SocketException e) { Log.AddWeb("(отправка запроса на чек) " + e.Message); return("ERROR|Ошибка отправки запроса на чек"); } return(requestResult); }
private void addService_Click(object sender, RoutedEventArgs e) { Button Service = sender as Button; ManualDocPack.AddService(Service.Name.TrimEnd('R')); modifyService_Click(sender, e); }
private void AddedNonPricedService(TextBox field, string service) { decimal summ = DocPack.manualParseDecimal(field.Text); if (summ > 0) { ManualDocPack.AddService(service + "=" + summ.ToString()); } }
private void reception_Click(object sender, RoutedEventArgs e) { ManualDocPack.CleanServices(); UpdateCenters(); MoveCanvas( moveCanvas: receptionPlace, prevCanvas: mainPlace ); }
private void removeService_Click(object sender, RoutedEventArgs e) { Button Service = sender as Button; string serviceName = Service.Name.Replace("_remove", ""); ManualDocPack.SubService(serviceName.TrimEnd('R')); Button serviceButton = mainGrid.FindName(serviceName) as Button; modifyService_Click(serviceButton, e, remove: true); }
private void check_Click(object sender, RoutedEventArgs e) { ManualDocPack.CleanServices(); UpdateCenters(); MoveCanvas( moveCanvas: checkPlace, prevCanvas: mainPlace, newHeight: 670 ); }
private void CleanCheck() { ButtonsClean( buttons: servButtonCleaningList, fontSize: 12 ); BlockCheckButton(block: false); foreach (TextBox text in new List <TextBox> { moneyForDHL, moneyForCheck, moneyForInsuranceRGS, moneyForInsuranceKL, directPaymentSending, priceForDirectPayment }) { text.Text = String.Empty; } foreach (Label label in new List <Label> { placeholderDHL, placeholderMoneyForCheck, placeholderRGS, placeholderKL, placeholderPrintSending, placeholderSection, placeholderStringForPrinting, placeholderForDirectPayment, placeholderDirectMoney }) { label.Visibility = Visibility.Visible; } foreach (Label label in new List <Label> { total, totalR }) { label.Content = String.Empty; } totalContent.Visibility = Visibility.Hidden; totalRContent.Visibility = Visibility.Hidden; returnDate.Text = String.Empty; // CleanRCheck ButtonsClean( buttons: receptionButtonCleaningList, fontSize: 18 ); BlockRCheckButton(block: false); ManualDocPack.CleanServices(); moneyForRCheck.Text = String.Empty; foreach (Button button in new List <Button>() { anketasrvR, printsrvR, photosrvR, xeroxR, srv11R }) { button.IsEnabled = true; } // Direct stringForPrinting.Text = String.Empty; section.Text = String.Empty; vatDirectPayment.IsChecked = true; moneyForDirectPayment.Text = String.Empty; }
private void modifyService_Click(object sender, RoutedEventArgs e, bool remove = false) { Button Service = sender as Button; bool rService = (Service.Name.EndsWith("R") ? true : false); int serviceNum = ManualDocPack.GetService(Service.Name.TrimEnd('R')); Canvas currentCanvas = (rService ? receptionPlace : checkPlace); if (serviceNum > 0) { bool tightButton = (Service.Height == 30 ? true : false); if ((serviceNum == 1) && !remove) { Service.Width -= 40; Button removeService = new Button(); removeService.Click += removeService_Click; removeService.Name = Service.Name + "_remove"; removeService.Width = 40; removeService.Height = Service.Height; removeService.Content = "X"; removeService.FontSize = (tightButton ? 14 : 20);; removeService.Tag = Service.Tag; removeService.Background = Service.Background; removeService.Margin = new Thickness(Canvas.GetLeft(Service) + Service.Width, Canvas.GetTop(Service), 0, 0); currentCanvas.Children.Add(removeService); currentCanvas.RegisterName(removeService.Name, removeService); } Service.FontWeight = FontWeights.Bold; Label labelService = Service.FindName(Service.Name + "_num") as Label; double topPositionBig = (rService ? -22 : 6) + (tightButton ? 6 : 0); double topPositionLtl = (rService ? 32 : 3) - (tightButton ? 5 : 0); if (labelService == null) { Label newLabel = new Label(); newLabel.Name = Service.Name + "_num"; newLabel.Content = serviceNum.ToString(); newLabel.FontSize = 30; Service.Width -= 30; Canvas.SetLeft(Service, Canvas.GetLeft(Service) + 30); Canvas.SetLeft(newLabel, Canvas.GetLeft(Service) - 32); Canvas.SetTop(newLabel, Canvas.GetTop(Service) - topPositionBig); currentCanvas.Children.Add(newLabel); currentCanvas.RegisterName(newLabel.Name, newLabel); } else { labelService.FontSize = (serviceNum >= 10 ? 18 : 30); Canvas.SetTop(labelService, Canvas.GetTop(Service) + (serviceNum >= 10 ? topPositionLtl : (topPositionBig * -1))); Canvas.SetLeft(labelService, Canvas.GetLeft(Service) - 32); labelService.Content = serviceNum.ToString(); } } else { CleanButton(Service, currentCanvas); } }