Пример #1
0
        public bool AddInvoice(DataLayer dt)
        {
            int rep = 0;

            try
            {
                object[,] Params = new object[2, 4];
                Params[0, 0]     = "@InvoiceID";
                Params[1, 0]     = this.ID;
                Params[0, 1]     = "@InvoiceDate";
                Params[1, 1]     = Transform.DateToString(this.InvoiceDate);
                Params[0, 2]     = "@IsPayed";
                Params[1, 2]     = 0;
                Params[0, 3]     = "@SupplierID";
                Params[1, 3]     = this.Supplier;
                rep = dt.ExecuteActionCommand_StoredProcedure("AddInvoice", Params);
                if (rep > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch { return(false); }
        }
Пример #2
0
        }                                              //function


        #region functions
        public bool AddInvoiceDetails(DataLayer dt)
        {
            int rep = 0;

            try
            {
                object[,] Params = new object[2, 7];
                Params[0, 0]     = "@InvoiceID";
                Params[1, 0]     = this.InvoiceID;
                Params[0, 1]     = "@MedecineID";
                Params[1, 1]     = this.MedecineID;
                Params[0, 2]     = "@Quantity";
                Params[1, 2]     = this.Quantity;
                Params[0, 3]     = "@UnitPrice";
                Params[1, 3]     = this.UnitPrice;
                Params[0, 4]     = "@Discount";
                Params[1, 4]     = this.Discount;
                Params[0, 5]     = "@VAT";
                Params[1, 5]     = this.VAT;
                Params[0, 6]     = "@ExpiryDate";
                Params[1, 6]     = Transform.DateToString(this.ExpiryDate);
                rep = dt.ExecuteActionCommand_StoredProcedure("AddInvoiceDetails", Params);
                if (rep > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch { return(false); }
        }
        public static bool AddInvoiceDetails(DataLayer dt, object[,] Params)
        {
            int rep = 0;

            try
            {
                rep = dt.ExecuteActionCommand_StoredProcedure("AddInvoiceDetails", Params);
                if (rep > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch { return(false); }
        }
Пример #4
0
        public static bool UpdateStocks(DataLayer dt, int M_ID, int AddedQuantity)
        {
            int rep = 0;

            try
            {
                object[,] Params = new object[2, 2];
                Params[0, 0]     = "@M_ID";
                Params[1, 0]     = M_ID;
                Params[0, 1]     = "@Qty";
                Params[1, 1]     = AddedQuantity;
                rep = dt.ExecuteActionCommand_StoredProcedure("UpdateStocks", Params);
                if (rep > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch { return(false); }
        }