public override string Print()
        {
            string products = _productEditor.ConsolePrintProducts(Products);

            CalcGoodsSum();
            string result = $"| -Квитанция за {PaymentName}- |\n"
                            + $"| Документ от - {DocDate.ToString("d")}|\n| № - {DocId} |\n"
                            + $"| Исполнитель - {Provider} |\n"
                            + $"| Заказчик - {Client} |\n"
                            + $"| Продукт/услуга |\n\n"
                            + $"{products} |";

            return(result);
        }
示例#2
0
        public override int GetHashCode()
        {
            int hashCode = 98921229;

            hashCode = hashCode * -1521134295 + DocEntry.GetHashCode();
            hashCode = hashCode * -1521134295 + DocNum.GetHashCode();
            hashCode = hashCode * -1521134295 + DocDate.GetHashCode();
            hashCode = hashCode * -1521134295 + DocDueDate.GetHashCode();
            hashCode = hashCode * -1521134295 + TaxDate.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(DocStatus);

            hashCode = hashCode * -1521134295 + UpdateDate.GetHashCode();
            return(hashCode);
        }
        public override string Print()
        {
            string products = _productEditor.ConsolePrintProducts(Products);

            CalcGoodsSum();
            string result = "| -Накладная- |\n"
                            + $"| Документ от - {DocDate.ToString("d")}|\n| № - {DocId} |\n"
                            + $"| Исполнитель - {Provider} |\n| ИНН - {ProviderId} |\n"
                            + $"| Заказчик - {Client}|\n| ИНН - {ClientId} |\n"
                            + $"\n| Продукт/услуга |\n"
                            + $"{products} |";

            return(result);
        }
示例#4
0
        public override int GetHashCode()
        {
            int hashCode = 1540013303;

            hashCode = hashCode * -1521134295 + DocEntry.GetHashCode();
            hashCode = hashCode * -1521134295 + DocNum.GetHashCode();
            hashCode = hashCode * -1521134295 + DocDate.GetHashCode();
            hashCode = hashCode * -1521134295 + DocDueDate.GetHashCode();
            hashCode = hashCode * -1521134295 + TaxDate.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(DocStatus);

            hashCode = hashCode * -1521134295 + UpdateDate.GetHashCode();
            hashCode = hashCode * -1521134295 + PurchaseRequestId.GetHashCode();
            return(hashCode);
        }
示例#5
0
        /// <summary>
        /// Generates hash code
        /// </summary>
        /// <returns>hash code</returns>
        public override int GetHashCode()
        {
            var hashCode = 2126638501;

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(ReqName);

            hashCode = hashCode * -1521134295 + ReqType.GetHashCode();
            hashCode = hashCode * -1521134295 + DocEntry.GetHashCode();
            hashCode = hashCode * -1521134295 + DocNum.GetHashCode();
            hashCode = hashCode * -1521134295 + DocDate.GetHashCode();
            hashCode = hashCode * -1521134295 + DocDueDate.GetHashCode();
            hashCode = hashCode * -1521134295 + TaxDate.GetHashCode();
            hashCode = hashCode * -1521134295 + ReqDate.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <List <PRQ1> > .Default.GetHashCode(Items);

            return(hashCode);
        }
        public override string HtmlPrint()
        {
            string products = _productEditor.HtmlPrintProducts(Products);

            CalcGoodsSum();
            string result = $"<h4 class='docHeader badge badge-info'>Квитанция</h4><span> за \"{PaymentName}\"</span>"
                            + $"<div class='docContent'><li>Документ от - {DocDate.ToString("d")}</li><li>№ - {DocId}</li>"
                            + $"<li>Исполнитель - {Provider}</li>"
                            + $"<li>Заказчик - {Client}</li></div>"
                            + $"<h4>Продукт/услуга</h4>"
                            + $"<table class=\'docProducts table table-bordered\'>"
                            + $"<thead><tr><th scope=\"col\">#</th><th scope=\"col\">Наименование</th><th scope=\"col\">Ед.</th><th scope=\"col\">Количество</th><th scope=\"col\">Стоимость ед.</th><th scope=\"col\">Сумма</th></tr></thead>"
                            + $"{products}</table>";

            result += $"<div class='docGoodsSum'><span id=\'goodsSumSpan\' class='badge badge-success'>Общая сумма {GoodsSum}$</span></div>";
            return(result);
        }
示例#7
0
        /// <summary>
        /// Generates hash code
        /// </summary>
        /// <returns>hash code</returns>
        public override int GetHashCode()
        {
            var hashCode = -144526589;

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(CardCode);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(CardName);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(NumAtCard);

            hashCode = hashCode * -1521134295 + DocEntry.GetHashCode();
            hashCode = hashCode * -1521134295 + DocNum.GetHashCode();
            hashCode = hashCode * -1521134295 + DocDate.GetHashCode();
            hashCode = hashCode * -1521134295 + DocDueDate.GetHashCode();
            hashCode = hashCode * -1521134295 + TaxDate.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <List <RDR1> > .Default.GetHashCode(Items);

            return(hashCode);
        }
        private void FillLV()
        {
            int    count = table == null ? 0 : table.Rows.Count;
            string msg   = Environment.StringResources.GetString("SimilarDocsDialog.ChooseDocDialog_Load.Message1") + " " +
                           count + " ";

            list.Items.Clear();

            if (count > 0 && table != null)
            {
                list.Visible = true;
                switch (count % 10)
                {
                case 1:
                    if (Environment.CurCultureInfo.TwoLetterISOLanguageName.Equals("ru"))
                    {
                        if (count != 11)
                        {
                            msg +=
                                Environment.StringResources.GetString(
                                    "SimilarDocsDialog.ChooseDocDialog_Load.Message2");
                        }
                        else
                        {
                            msg +=
                                Environment.StringResources.GetString(
                                    "SimilarDocsDialog.ChooseDocDialog_Load.Message4");
                        }
                    }
                    else
                    {
                        if (count == 1)
                        {
                            msg +=
                                Environment.StringResources.GetString(
                                    "SimilarDocsDialog.ChooseDocDialog_Load.Message2");
                        }
                        else
                        {
                            msg +=
                                Environment.StringResources.GetString(
                                    "SimilarDocsDialog.ChooseDocDialog_Load.Message4");
                        }
                    }
                    break;

                case 2:
                case 3:
                case 4:
                    msg += Environment.StringResources.GetString("SimilarDocsDialog.ChooseDocDialog_Load.Message3");
                    break;

                case 5:
                case 6:
                case 7:
                case 8:
                case 9:
                    msg += Environment.StringResources.GetString("SimilarDocsDialog.ChooseDocDialog_Load.Message4");
                    break;
                }

                msg += " " + Environment.StringResources.GetString("To") + " " + typeStr + " " +
                       Environment.StringResources.GetString("Num");

                if (NumberStr != "")
                {
                    msg += NumberStr;
                }
                else
                {
                    msg += Environment.StringResources.GetString("SimilarDocsDialog.ChooseDocDialog_Load.Message5");
                }

                msg += " " + Environment.StringResources.GetString("Of") + " ";

                if (DocDate > DateTime.MinValue)
                {
                    msg += DocDate.ToString("dd.MM.yyyy");
                }
                else
                {
                    msg += Environment.StringResources.GetString("SimilarDocsDialog.ChooseDocDialog_Load.Message6");
                }

                if (list.Columns.Count == 0)
                {
                    list.Columns.Add(Environment.StringResources.GetString("ID"), 60, HorizontalAlignment.Left);
                    list.Columns.Add(Lib.Win.Document.Environment.StringResources.GetString("DocumentName"), 120,
                                     HorizontalAlignment.Left);
                    list.Columns.Add(Environment.StringResources.GetString("DocumentNumber"), 80,
                                     HorizontalAlignment.Left);
                    list.Columns.Add(Environment.StringResources.GetString("Description"), 180, HorizontalAlignment.Left);
                    list.Columns.Add(
                        Environment.StringResources.GetString("LoopLinkDialog.ChooseDocDialog_Load.Message2"), 130,
                        HorizontalAlignment.Center);
                }

                foreach (DataRow dr in table.Rows)
                {
                    var id = (int)dr[Environment.DocData.IDField];

                    var values = new string[5];

                    // код документа
                    values[0] = id.ToString();

                    // тип документа
                    if (string.IsNullOrEmpty(dr[Environment.DocData.NameField].ToString()))
                    {
                        if (Environment.CurCultureInfo.TwoLetterISOLanguageName.Equals("ru"))
                        {
                            values[1] = dr[Environment.DocData.DocTypeField].ToString();
                        }
                        else if (table.Columns.Contains(Environment.DocData.DocTypeEngField))
                        {
                            values[1] = dr[Environment.DocData.DocTypeEngField].ToString();
                        }
                        else
                        {
                            values[1] = dr[Environment.DocData.DocTypeField].ToString();
                        }
                    }
                    else
                    {
                        values[1] = dr[Environment.DocData.NameField].ToString();
                    }

                    object obj;
                    // номер
                    obj = dr[Environment.DocData.NumberField];
                    if (!obj.Equals(DBNull.Value))
                    {
                        values[2] = obj.ToString();
                    }

                    // описание
                    obj = dr[Environment.DocData.DescriptionField];
                    if (!obj.Equals(DBNull.Value))
                    {
                        values[3] = obj.ToString();
                    }

                    // доступен?
                    var  available = (int)dr[Environment.DocData.RightsField];
                    bool rights    = (available == 1);
                    if (rights)
                    {
                        values[4] = Environment.StringResources.GetString("Available");
                    }
                    else
                    {
                        values[4] = Environment.StringResources.GetString("NotAvailable");
                    }

                    var item = new DocListItem(id, rights, values);
                    if (!item.Rights)
                    {
                        item.ForeColor = Color.Gray;
                    }

                    list.Items.Add(item);
                }
            }
            else
            {
                list.Visible = false;
            }
            labelX.Text = msg;
            UpdateControls();
        }
示例#9
0
        public void Export()
        {
            DataTable tbmTable = new DataTable("TBM");

            using (SqlCommand command = new SqlCommand())
                using (SqlDataAdapter adapter = new SqlDataAdapter(command))
                {
                    command.Connection  = dbinit.db;
                    command.CommandText = @"
SELECT
	g.marking
	--, g.name AS name
	, sdp.thick
	, sdp.comment AS manufact_name
	, dbo.fo_getBarCodeValue_mc(sdp.fo_idmodelcalc) AS bar_code
    , ROW_NUMBER() OVER(PARTITION BY sdp.comment ORDER BY sdp.fo_idmodelcalc) AS order_nn
	, COUNT(*) OVER(PARTITION BY sdp.comment) AS order_count
FROM  supplydocpos AS sdp
INNER JOIN good AS g ON sdp.idgood = g.idgood
WHERE sdp.idsupplydoc = @idsupplydoc
AND sdp.deleted IS NULL
AND g.idgoodtype = 13
AND g.idcustomer = 60520 -- Поставщик ТБМ";

                    command.Parameters.AddWithValue("@idsupplydoc", supplyDocumentId);
                    adapter.Fill(tbmTable);
                }

            XElement xWindowsills = new XElement("Windowsills");

            foreach (DataRow row in tbmTable.Rows)
            {
                //string name = (string)row["name"];

                string article = (string)row["marking"]; // Артикул

                double length = ((int)row["thick"]) / 10.0;

                string manufactName = (string)row["manufact_name"];

                // -- "Номер в заказе"
                int orderNN = Convert.ToInt32(row["order_nn"]);

                // -- Общее количество в заказе
                int orderCount = Convert.ToInt32(row["order_count"]);

                string marking = string.Concat(manufactName, " ", orderNN, "/", orderCount);
                // -- Штрих код
                string barCode = (string)row["bar_code"];

                xWindowsills.Add(new XElement("Windowsill",
                                                                                           //new XAttribute("Name", name),
                                              new XAttribute("Article", article),
                                              new XAttribute("Length", length.ToString()), //ToString дает запятую вместо точки.
                                              new XAttribute("Marking", marking),
                                              new XAttribute("BarCode", barCode)));
            }

            Contractor contractor = Contractor.GetContractor();

            XElement xHead = new XElement("RequestInfo",
                                          new XAttribute("CustCode", 31625),
                                          new XAttribute("RequestDate", DocDate),
                                          new XAttribute("DeliveryDate", DocDate.AddDays(2)),
                                          new XAttribute("DeliveryAddress", contractor.Address));

            XElement result = new XElement("Request",
                                           new XComment("RequestInfo - Информация по заявке."),
                                           new XComment("CustCode - шифр клиента"),
                                           new XComment("RequestDate - Дата заявки"),
                                           new XComment("DeliveryDate - Дата доставки"),
                                           new XComment("DeliveryAddress - Адрес доставки"));

            result.Add(xHead);

            result.Add(new XComment("Windowsills - подоконники"));
            result.Add(new XComment("Article - Артикул"));
            result.Add(new XComment("Length - длина подоконика в см."));
            result.Add(new XComment("Marking - маркировка"));
            result.Add(new XComment("BarCode - Штрих код"));
            result.Add(xWindowsills);



            result.Save(FullFileName);
        }
示例#10
0
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 /// <returns>An hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.</returns>
 public override int GetHashCode()
 {
     return(string.Concat("DocListFilteredCriteria", DocID.ToString(), DocClassID.ToString(), DocTypeID.ToString(), SenderID.ToString(), RecipientID.ToString(), DocRef.ToString(), DocDate.ToString(), Subject.ToString(), DocStatusID.ToString(), CreateDate.ToString(), CreateUserID.ToString(), ChangeDate.ToString(), ChangeUserID.ToString()).GetHashCode());
 }
示例#11
0
 /// <summary>
 /// Determines whether the specified <see cref="System.Object"/> is equal to this instance.
 /// </summary>
 /// <param name="obj">The <see cref="System.Object"/> to compare with this instance.</param>
 /// <returns><c>true</c> if the specified <see cref="System.Object"/> is equal to this instance; otherwise, <c>false</c>.</returns>
 public override bool Equals(object obj)
 {
     if (obj is DocListFilteredCriteria)
     {
         var c = (DocListFilteredCriteria)obj;
         if (!DocID.Equals(c.DocID))
         {
             return(false);
         }
         if (!DocClassID.Equals(c.DocClassID))
         {
             return(false);
         }
         if (!DocTypeID.Equals(c.DocTypeID))
         {
             return(false);
         }
         if (!SenderID.Equals(c.SenderID))
         {
             return(false);
         }
         if (!RecipientID.Equals(c.RecipientID))
         {
             return(false);
         }
         if (!DocRef.Equals(c.DocRef))
         {
             return(false);
         }
         if (!DocDate.Equals(c.DocDate))
         {
             return(false);
         }
         if (!Subject.Equals(c.Subject))
         {
             return(false);
         }
         if (!DocStatusID.Equals(c.DocStatusID))
         {
             return(false);
         }
         if (!CreateDate.Equals(c.CreateDate))
         {
             return(false);
         }
         if (!CreateUserID.Equals(c.CreateUserID))
         {
             return(false);
         }
         if (!ChangeDate.Equals(c.ChangeDate))
         {
             return(false);
         }
         if (!ChangeUserID.Equals(c.ChangeUserID))
         {
             return(false);
         }
         return(true);
     }
     return(false);
 }
示例#12
0
 public override string ToString()
 {
     return(DocNumber + " от " + DocDate.ToShortDateString());
 }