Esempio n. 1
0
        public int InsertDiscountForTotal(Decimal AMOUNT_FROM, Decimal AMOUNT_TO, Decimal DISCOUNT, String DISCOUNT_TYPE, Boolean DISCOUNT_PERIOADICALLY, DateTime DISCOUNT_FROM, DateTime DISCOUNT_TO)
        {
            String query = "INSERT INTO [dbo].[Discount_Type2]  ([AMOUNT_FROM]  ,[AMOUNT_TO] ,[DISCOUNT]  ,[DISCOUNT_TYPE]  ,[DISCOUNT_PERIOADICALLY]  ,[DISCOUNT_FROM] ,[DISCOUNT_TO])  VALUES (@AMOUNT_FROM  ,@AMOUNT_TO  ,@DISCOUNT  ,@DISCOUNT_TYPE ,@DISCOUNT_PERIOADICALLY ,@DISCOUNT_FROM,@DISCOUNT_TO)";

            SqlParameter[] sqlParams = new SqlParameter[] {
                new SqlParameter("@AMOUNT_FROM", SqlDbType.Decimal),
                new SqlParameter("@AMOUNT_TO", SqlDbType.Decimal),
                new SqlParameter("@DISCOUNT", SqlDbType.Decimal),
                new SqlParameter("@DISCOUNT_TYPE", SqlDbType.VarChar),
                new SqlParameter("@DISCOUNT_PERIOADICALLY", SqlDbType.Bit),
                new SqlParameter("@DISCOUNT_FROM", SqlDbType.DateTime),
                new SqlParameter("@DISCOUNT_TO", SqlDbType.DateTime),
            };

            sqlParams[0].Value = AMOUNT_FROM;
            sqlParams[1].Value = AMOUNT_TO;
            sqlParams[2].Value = DISCOUNT;
            sqlParams[3].Value = DISCOUNT_TYPE;
            sqlParams[4].Value = DISCOUNT_PERIOADICALLY;
            sqlParams[5].Value = DISCOUNT_FROM;
            sqlParams[6].Value = DISCOUNT_TO;

            DataInsertManager dim = new DataInsertManager();

            return(dim.insertRecord(query, ref sqlParams));
        }
Esempio n. 2
0
        public int InsertIvoice(int INVOICE_NO, decimal Amount, decimal Discount, decimal LineDiscount, decimal TaxAmount, DateTime EnterderDate, decimal PaidAmount, decimal VoucherAmount, decimal BalanceAmount)
        {
            String selectCommand = "INSERT INTO [dbo].[Invoice_Data]([INVOICE_ID],[INVOICE_TOTAL],[DISCOUNT_AMOUNT],[LINE_DISCOUNT_AMOUNT],[TAX_AMOUNT],[INVOICE_DATE],[PAID_AMOUNT],[VOUCHER_AMOUNT],[BALANCE_AMOUNT])VALUES(@INVOICE_ID,@INVOICE_TOTAL,@DISCOUNT_AMOUNT,@LINE_DISCOUNT_AMOUNT,@TAX_AMOUNT,@INVOICE_DATE,@PAID_AMOUNT,@VOUCHER_AMOUNT,@BALANCE_AMOUNT)";

            SqlParameter[] sqlParams = new SqlParameter[] {
                new SqlParameter("@INVOICE_ID", SqlDbType.Int),
                new SqlParameter("@INVOICE_TOTAL", SqlDbType.Decimal),
                new SqlParameter("@DISCOUNT_AMOUNT", SqlDbType.Decimal),
                new SqlParameter("@LINE_DISCOUNT_AMOUNT", SqlDbType.Decimal),
                new SqlParameter("@TAX_AMOUNT", SqlDbType.Decimal),
                new SqlParameter("@INVOICE_DATE", SqlDbType.DateTime),
                new SqlParameter("@PAID_AMOUNT", SqlDbType.Decimal),
                new SqlParameter("@VOUCHER_AMOUNT", SqlDbType.Decimal),
                new SqlParameter("@BALANCE_AMOUNT", SqlDbType.Decimal),
            };

            sqlParams[0].Value = INVOICE_NO;
            sqlParams[1].Value = Amount;
            sqlParams[2].Value = Discount;
            sqlParams[3].Value = LineDiscount;
            sqlParams[4].Value = TaxAmount;
            sqlParams[5].Value = EnterderDate;
            sqlParams[6].Value = PaidAmount;
            sqlParams[7].Value = VoucherAmount;
            sqlParams[8].Value = BalanceAmount;

            DataInsertManager dim = new DataInsertManager();

            return(dim.insertRecord(selectCommand, ref sqlParams));
        }
Esempio n. 3
0
        public int insertStockBalanceDefault(int Category_ID, Decimal Balance)
        {
            String selectCommand = "INSERT INTO [dbo].[Stock_Balance]([ITEMCAT_ID],[BALANCE])VALUES(@Category_ID,@Balance)";

            SqlParameter[] sqlParams = new SqlParameter[] {
                new SqlParameter("@Category_ID", SqlDbType.Int),
                new SqlParameter("@Balance", SqlDbType.Decimal),
            };

            sqlParams[0].Value = Category_ID;
            sqlParams[1].Value = Balance;


            DataInsertManager dim = new DataInsertManager();

            return(dim.insertRecord(selectCommand, ref sqlParams));
        }
Esempio n. 4
0
        public int insertBrand(String Brand_NAME, String Brand_Discription, Boolean BrandStatus)
        {
            String selectCommand = "INSERT INTO[dbo].[Brand]([BRAND_NAME],[BRAND_DISCRIPTION],[BRAND_STATUS])VALUES(@BRAND_NAME, @BRAND_DISCRIPTION, @BRAND_STATUS)";

            SqlParameter[] sqlParams = new SqlParameter[] {
                new SqlParameter("@BRAND_NAME", SqlDbType.VarChar),
                new SqlParameter("@BRAND_DISCRIPTION", SqlDbType.VarChar),
                new SqlParameter("@BRAND_STATUS", SqlDbType.Bit),
            };

            sqlParams[0].Value = Brand_NAME;
            sqlParams[1].Value = Brand_Discription;
            sqlParams[2].Value = BrandStatus;

            DataInsertManager dim = new DataInsertManager();

            return(dim.insertRecord(selectCommand, ref sqlParams));
        }
Esempio n. 5
0
        public int insertCustomer(String CUSTOMER_NAME, String CONTACT_NO)
        {
            String selectCommand = "INSERT INTO [dbo].[Customer] ([CUSTOMER_NAME] ,[CONTACT_NO]  ,[ENTERED_DATE])  VALUES  (@CUSTOMER_NAME ,@CONTACT_NO  ,GETDATE())";

            SqlParameter[] sqlParams = new SqlParameter[] {
                new SqlParameter("@CUSTOMER_NAME", SqlDbType.Char, 100),
                new SqlParameter("@CONTACT_NO", SqlDbType.Char, 10)
            };

            sqlParams[0].Value = CUSTOMER_NAME;
            sqlParams[1].Value = CONTACT_NO;



            DataInsertManager dim = new DataInsertManager();

            return(dim.insertRecord(selectCommand, ref sqlParams));
        }
Esempio n. 6
0
        public int insertItem(String ITEM_NAME, String Item_Discription, Boolean ItemStatus)
        {
            String selectCommand = "INSERT INTO[dbo].[Items]([ITEM_NAME],[ITEM_DISCRIPTION],[ITEM_STATUS])VALUES(@ITEM_NAME, @Item_Discription, @ItemStatus)";

            SqlParameter[] sqlParams = new SqlParameter[] {
                new SqlParameter("@ITEM_NAME", SqlDbType.VarChar),
                new SqlParameter("@Item_Discription", SqlDbType.VarChar),
                new SqlParameter("@ItemStatus", SqlDbType.Bit),
            };

            sqlParams[0].Value = ITEM_NAME;
            sqlParams[1].Value = Item_Discription;
            sqlParams[2].Value = ItemStatus;

            DataInsertManager dim = new DataInsertManager();

            return(dim.insertRecord(selectCommand, ref sqlParams));
        }
Esempio n. 7
0
        public int insertVoucher(String VOUCHER_NO, String BARCODE, Decimal AMOUNT)
        {
            String selectCommand = "INSERT INTO [dbo].[Voucher] ([VOUCHER_NO]  ,[BARCODE]  ,[AMOUNT] ) VALUES (@VOUCHER_NO  ,@BARCODE  ,@AMOUNT)";

            SqlParameter[] sqlParams = new SqlParameter[] {
                new SqlParameter("@VOUCHER_NO", SqlDbType.VarChar),
                new SqlParameter("@BARCODE", SqlDbType.VarChar),
                new SqlParameter("@AMOUNT", SqlDbType.Decimal)
            };

            sqlParams[0].Value = VOUCHER_NO;
            sqlParams[1].Value = BARCODE;
            sqlParams[2].Value = AMOUNT;



            DataInsertManager dim = new DataInsertManager();

            return(dim.insertRecord(selectCommand, ref sqlParams));
        }
Esempio n. 8
0
        public int InsertTransaction(int INVOICE_NO, int ITEMCAT_ID, decimal CAT_QUANTITY, String TRANSACTION_TYPE, decimal BUYING_COST, decimal SELLING_COST, decimal DISCOUNT_AMOUNT, decimal NET_AMOUNT, decimal CURR_STOCK_BALANCE, decimal NEW_STOCK_BALANCE, string USER_NAME, DateTime EXPIERY_DATE, string VENDER, int INVOICE_NO_REFNDER)
        {
            String selectCommand = "INSERT INTO [dbo].[Transaction] ([INVOICE_NO] ,[ITEMCAT_ID],[CAT_QUANTITY],[TRANSACTION_TYPE] ,[BUYING_COST] ,[SELLING_COST],[DISCOUNT_AMOUNT],[NET_AMOUNT],[CURR_STOCK_BALANCE],[NEW_STOCK_BALANCE] ,[USER_NAME] ,[ENTERED_DATE],[EXPIERY_DATE],[Vender/Customer],[INVOICE_NO_REF]) VALUES(@INVOICE_NO,@ITEMCAT_ID,@CAT_QUANTITY,@TRANSACTION_TYPE ,@BUYING_COST,@SELLING_COST,@DISCOUNT_AMOUNT,@NET_AMOUNT,@CURR_STOCK_BALANCE,@NEW_STOCK_BALANCE,@USER_NAME,GetDate(),@EXPIERY_DATE,@VENDER,@INVOICE_NO_REF)";

            SqlParameter[] sqlParams = new SqlParameter[] {
                new SqlParameter("@INVOICE_NO", SqlDbType.Int),
                new SqlParameter("@ITEMCAT_ID", SqlDbType.Int),
                new SqlParameter("@CAT_QUANTITY", SqlDbType.Decimal),
                new SqlParameter("@TRANSACTION_TYPE", SqlDbType.Char),
                new SqlParameter("@BUYING_COST", SqlDbType.Decimal),
                new SqlParameter("@SELLING_COST", SqlDbType.Decimal),
                new SqlParameter("@DISCOUNT_AMOUNT", SqlDbType.Decimal),
                new SqlParameter("@NET_AMOUNT", SqlDbType.Decimal),
                new SqlParameter("@CURR_STOCK_BALANCE", SqlDbType.Decimal),
                new SqlParameter("@NEW_STOCK_BALANCE", SqlDbType.Decimal),
                new SqlParameter("@USER_NAME", SqlDbType.Char),
                new SqlParameter("@EXPIERY_DATE", SqlDbType.DateTime),
                new SqlParameter("@VENDER", SqlDbType.Char),
                new SqlParameter("@INVOICE_NO_REF", SqlDbType.Int),
            };

            sqlParams[0].Value  = INVOICE_NO;
            sqlParams[1].Value  = ITEMCAT_ID;
            sqlParams[2].Value  = CAT_QUANTITY;
            sqlParams[3].Value  = TRANSACTION_TYPE;
            sqlParams[4].Value  = BUYING_COST;
            sqlParams[5].Value  = SELLING_COST;
            sqlParams[6].Value  = DISCOUNT_AMOUNT;
            sqlParams[7].Value  = NET_AMOUNT;
            sqlParams[8].Value  = CURR_STOCK_BALANCE;
            sqlParams[9].Value  = NEW_STOCK_BALANCE;
            sqlParams[10].Value = USER_NAME;
            sqlParams[11].Value = EXPIERY_DATE;
            sqlParams[12].Value = VENDER;
            sqlParams[13].Value = INVOICE_NO_REFNDER;

            DataInsertManager dim = new DataInsertManager();

            return(dim.insertRecord(selectCommand, ref sqlParams));
        }
Esempio n. 9
0
        public int insertUser(String USER_NAME, String PASSWORD, String NIC, String USER_TYPE, String FIRST_NAME, String LAST_NAME, String CONTACT_NO, String ADDRESS_NO, String STREET, String CITY, String DISTRICT, int STORE_ID)
        {
            String selectCommand = "INSERT INTO [dbo].[User_Details] ([USER_NAME] ,[PASSWORD],[NIC],[STATUS] ,[USER_TYPE] ,[FIRST_NAME],[LAST_NAME],[CONTACT_NO],[ADDRESS_NO] ,[STREET],[CITY],[DISTRICT] ,[STORE_ID])VALUES (@USER_NAME ,@PASSWORD ,@NIC ,1,@USER_TYPE,@FIRST_NAME,@LAST_NAME,@CONTACT_NO,@ADDRESS_NO ,@STREET,@CITY,@DISTRICT,@STORE_ID)";

            SqlParameter[] sqlParams = new SqlParameter[] {
                new SqlParameter("@USER_NAME", SqlDbType.Char),
                new SqlParameter("@PASSWORD", SqlDbType.Char),
                new SqlParameter("@NIC", SqlDbType.Char),
                new SqlParameter("@USER_TYPE", SqlDbType.Char),
                new SqlParameter("@FIRST_NAME", SqlDbType.Char),
                new SqlParameter("@LAST_NAME", SqlDbType.Char),
                new SqlParameter("@CONTACT_NO", SqlDbType.Char),
                new SqlParameter("@ADDRESS_NO", SqlDbType.Char),
                new SqlParameter("@STREET", SqlDbType.Char),
                new SqlParameter("@CITY", SqlDbType.Char),
                new SqlParameter("@DISTRICT", SqlDbType.Char),
                new SqlParameter("@STORE_ID", SqlDbType.Int),
            };

            sqlParams[0].Value  = USER_NAME;
            sqlParams[1].Value  = PASSWORD;
            sqlParams[2].Value  = NIC;
            sqlParams[3].Value  = USER_TYPE;
            sqlParams[4].Value  = FIRST_NAME;
            sqlParams[5].Value  = LAST_NAME;
            sqlParams[6].Value  = CONTACT_NO;
            sqlParams[7].Value  = ADDRESS_NO;
            sqlParams[8].Value  = STREET;
            sqlParams[9].Value  = CITY;
            sqlParams[10].Value = DISTRICT;
            sqlParams[11].Value = STORE_ID;



            DataInsertManager dim = new DataInsertManager();

            return(dim.insertRecord(selectCommand, ref sqlParams));
        }
Esempio n. 10
0
        public int insertItemCategory(String Category_NAME, String BRAND_ID, String Barcode_No, String Unit, decimal Buying, decimal Selling, String Item_Discription, Boolean ItemStatus, decimal Discount, String Discount_Type, String Item_ID, String Category_NAME_UNICODE)
        {
            String selectCommand = "INSERT INTO [dbo].[Item_Category]([CATEGORY_NAME],[BRAND_ID],[BARCODE],[UNIT],[BUYING_COST],[SELLING_COST],[CAT_DISCRIPTION],[CAT_STATUS],[ENTERDE_DATE],[DISCOUNT]  ,[DISCOUNT_TYPE],[ITEM_ID],[CATEGORY_NAME_UNICODE])VALUES(N'" + Category_NAME + "', @BRAND_ID, @Barcode_No, @Unit, @Buying, @Selling, @Item_Discription, @ItemStatus, @EnteredDate, @DISCOUNT,@DISCOUNT_TYPE, @ITEM_ID,N'" + Category_NAME_UNICODE + "')";

            SqlParameter[] sqlParams = new SqlParameter[] {
                new SqlParameter("@Category_NAME", SqlDbType.VarChar),
                new SqlParameter("@BRAND_ID", SqlDbType.Int),
                new SqlParameter("@Barcode_No", SqlDbType.VarChar),
                new SqlParameter("@Unit", SqlDbType.VarChar),
                new SqlParameter("@Buying", SqlDbType.Decimal),
                new SqlParameter("@Selling", SqlDbType.Decimal),
                new SqlParameter("@Item_Discription", SqlDbType.VarChar),
                new SqlParameter("@ItemStatus", SqlDbType.Bit),
                new SqlParameter("@EnteredDate", SqlDbType.DateTime),
                new SqlParameter("@DISCOUNT", SqlDbType.Decimal),
                new SqlParameter("@DISCOUNT_TYPE", SqlDbType.VarChar),
                new SqlParameter("@ITEM_ID", SqlDbType.Int),
                new SqlParameter("@CATEGORY_NAME_UNICODE", SqlDbType.VarChar)
            };

            sqlParams[0].Value  = Category_NAME;
            sqlParams[1].Value  = BRAND_ID;
            sqlParams[2].Value  = Barcode_No;
            sqlParams[3].Value  = Unit;
            sqlParams[4].Value  = Buying;
            sqlParams[5].Value  = Selling;
            sqlParams[6].Value  = Item_Discription;
            sqlParams[7].Value  = ItemStatus;
            sqlParams[8].Value  = DateTime.Now;
            sqlParams[9].Value  = Discount;
            sqlParams[10].Value = Discount_Type;
            sqlParams[11].Value = Item_ID;
            sqlParams[12].Value = Category_NAME_UNICODE;

            DataInsertManager dim = new DataInsertManager();

            return(dim.insertRecord(selectCommand, ref sqlParams));
        }