Example #1
0
        internal List <ItemInformationVM> SearchSellItemsBetweenDates(string formDate, string toDate)
        {
            List <ItemInformationVM> ItemInfoVMS = new List <ItemInformationVM>();

            Query = @"SELECT * FROM DateWiseStockOut Where StockOutDate between '" + formDate + "' and '" + toDate + "'";


            Command = new SqlCommand(Query, Connection);
            Connection.Open();

            Reader = Command.ExecuteReader();
            while (Reader.Read())
            {
                ItemInformationVM ItemInfoVM = new ItemInformationVM();

                ItemInfoVM.Name             = Reader["Name"].ToString();
                ItemInfoVM.StockOutQuantity = Convert.ToInt32(Reader["Quantity"]);
                ItemInfoVM.StockOutType     = Convert.ToInt32(Reader["StockOutType"]);

                ItemInfoVMS.Add(ItemInfoVM);
            }

            Reader.Close();
            Connection.Close();

            return(ItemInfoVMS);
        }
        internal List <ItemInformationVM> GetItemInfoByCompanyAndCategory(int companyId, int categoryId)
        {
            List <ItemInformationVM> ItemInfoVMS = new List <ItemInformationVM>();

            Query = @"SELECT * FROM ItemByCompanyOrCategory 
                        Where CategoryId = '" + categoryId + "' And CompanyId = '" + companyId + "'";

            Command = new SqlCommand(Query, Connection);
            Connection.Open();

            Reader = Command.ExecuteReader();
            while (Reader.Read())
            {
                ItemInformationVM ItemInfoVM = new ItemInformationVM();

                ItemInfoVM.Name              = Reader["ItemName"].ToString();
                ItemInfoVM.CompanyName       = Reader["CompanyName"].ToString();
                ItemInfoVM.RecorderLevel     = Convert.ToInt32(Reader["RecorderLevel"]);
                ItemInfoVM.AvailableQuantity = Convert.ToInt32(Reader["Quantity"]);

                ItemInfoVMS.Add(ItemInfoVM);
            }

            Reader.Close();
            Connection.Close();

            return(ItemInfoVMS);
        }