Exemple #1
0
        public ItemMaster GetItemMasterDetails(String itemID)
        {
            ItemMaster obj = null;

            string commandText = OleDBHelper.GetQueryText("ItemMaster_SelectID", QueryType.Procedures);

            OleDbParameter[] parameters = new OleDbParameter[]
            {
                new OleDbParameter("@ItemID", itemID)
            };

            using (DataTable table = OleDBHelper.ExecuteParamerizedSelectCommand(commandText, CommandType.Text, parameters))
            {
                //check if any record exist or not
                if (table.Rows.Count > 0)
                {
                    //Lets go ahead and create the list of employees
                    obj = new ItemMaster();

                    obj.ItemID   = Convert.ToString(table.Rows[0]["ItemID"]);
                    obj.ItemName = Convert.ToString(table.Rows[0]["ItemName"]);
                    obj.Remarks  = Convert.ToString(table.Rows[0]["Remarks"]);
                }
            }

            return(obj);
        }
        public BooksMaster GetBooksMasterDetails(String bookID)
        {
            BooksMaster obj = null;

            string commandText = OleDBHelper.GetQueryText("BooksMaster_SelectID", QueryType.Procedures);

            OleDbParameter[] parameters = new OleDbParameter[]
            {
                new OleDbParameter("@BookID", bookID)
            };

            using (DataTable table = OleDBHelper.ExecuteParamerizedSelectCommand(commandText, CommandType.Text, parameters))
            {
                //check if any record exist or not
                if (table.Rows.Count > 0)
                {
                    //Lets go ahead and create the list of employees
                    obj = new BooksMaster();

                    obj.BookID      = Convert.ToString(table.Rows[0]["BookID"]);
                    obj.ISBN        = Convert.ToString(table.Rows[0]["ISBN"]);
                    obj.Title       = Convert.ToString(table.Rows[0]["Title"]);
                    obj.Subject     = Convert.ToString(table.Rows[0]["Subject"]);
                    obj.Author      = Convert.ToString(table.Rows[0]["Author"]);
                    obj.Publication = Convert.ToString(table.Rows[0]["Publication"]);
                    obj.EditionNo   = Convert.ToInt32(table.Rows[0]["EditionNo"]);
                    obj.EditionYear = Convert.ToInt32(table.Rows[0]["EditionYear"]);
                    obj.Price       = Convert.ToInt32(table.Rows[0]["Price"]);
                }
            }

            return(obj);
        }
        public PartyMaster GetPartyMasterDetails(String partyID)
        {
            PartyMaster obj = null;

            string commandText = OleDBHelper.GetQueryText("PartyMaster_SelectID", QueryType.Procedures);

            OleDbParameter[] parameters = new OleDbParameter[]
            {
                new OleDbParameter("@PartyID", partyID)
            };

            using (DataTable table = OleDBHelper.ExecuteParamerizedSelectCommand(commandText, CommandType.Text, parameters))
            {
                //check if any record exist or not
                if (table.Rows.Count > 0)
                {
                    //Lets go ahead and create the list of employees
                    obj = new PartyMaster();

                    obj.PartyID      = Convert.ToString(table.Rows[0]["PartyID"]);
                    obj.PartyName    = Convert.ToString(table.Rows[0]["PartyName"]);
                    obj.PersonName   = Convert.ToString(table.Rows[0]["PersonName"]);
                    obj.Address      = Convert.ToString(table.Rows[0]["Address"]);
                    obj.ContactNo    = Convert.ToString(table.Rows[0]["ContactNo"]);
                    obj.Mobile       = Convert.ToString(table.Rows[0]["Mobile"]);
                    obj.EamilAddress = Convert.ToString(table.Rows[0]["EamilAddress"]);
                    obj.Remarks      = Convert.ToString(table.Rows[0]["Remarks"]);
                }
            }

            return(obj);
        }
        public TransactionInMaster GetTransactionInMaster(string transactionID)
        {
            TransactionInMaster obj = null;

            string commandText = OleDBHelper.GetQueryText("TransactionInMaster_SelectID", QueryType.Procedures);

            OleDbParameter[] parameters = new OleDbParameter[]
            {
                new OleDbParameter("@TransactionID", transactionID)
            };

            using (DataTable table = OleDBHelper.ExecuteParamerizedSelectCommand(commandText, CommandType.Text, parameters))
            {
                //check if any record exist or not
                if (table.Rows.Count > 0)
                {
                    //Lets go ahead and create the list of employees
                    obj = new TransactionInMaster();

                    obj.TransactionID   = Convert.ToString(table.Rows[0]["TransactionID"]);
                    obj.TransactionDate = Convert.ToDateTime(table.Rows[0]["TransactionDate"]);
                    obj.PartyID         = Convert.ToString(table.Rows[0]["PartyID"]);
                    obj.Amount          = Convert.ToDecimal(Convert.IsDBNull(table.Rows[0]["Amount"]) ? 0 : table.Rows[0]["Amount"]);
                    obj.Remarks         = Convert.ToString(table.Rows[0]["Remarks"]);
                }
            }

            return(obj);
        }
Exemple #5
0
        public Inventory GetInventoryDetails(Inventory obj)
        {
            Inventory objDetails = null;

            string commandText = OleDBHelper.GetQueryText("Inventory_SelectID", QueryType.Procedures);

            OleDbParameter[] parameters = new OleDbParameter[]
            {
                new OleDbParameter("@ItemID", obj.ItemID)
                //new OleDbParameter("@UnitID", obj.UnitID)
            };

            using (DataTable table = OleDBHelper.ExecuteParamerizedSelectCommand(commandText, CommandType.Text, parameters))
            {
                //check if any record exist or not
                if (table.Rows.Count > 0)
                {
                    //Lets go ahead and create the list of employees
                    objDetails = new Inventory();

                    objDetails.ItemID      = Convert.ToString(table.Rows[0]["ItemID"]);
                    objDetails.UnitID      = Convert.ToString(table.Rows[0]["UnitID"]);
                    objDetails.LastTranID  = Convert.ToString(table.Rows[0]["LastTranID"]);
                    objDetails.QtyIn       = Convert.IsDBNull(table.Rows[0]["QtyIn"])? 0 : Convert.ToInt32(table.Rows[0]["QtyIn"]);
                    objDetails.QtyOut      = Convert.IsDBNull(table.Rows[0]["QtyOut"]) ? 0 : Convert.ToInt32(table.Rows[0]["QtyOut"]);
                    objDetails.PrevBalance = Convert.IsDBNull(table.Rows[0]["PrevBalance"]) ? 0 : Convert.ToInt32(table.Rows[0]["PrevBalance"]);
                    objDetails.CurrBalance = Convert.IsDBNull(table.Rows[0]["CurrBalance"]) ? 0 : Convert.ToInt32(table.Rows[0]["CurrBalance"]);
                }
            }

            return(objDetails);
        }
        public static DataTable GetUniqueCodeForTable(string tableName)
        {
            DataTable dt = new DataTable();

            OleDbParameter[] parameters = new OleDbParameter[]
            {
                new OleDbParameter("@TableName", tableName)
            };
            string commandText = OleDBHelper.GetQueryText("GetUniqueCodeForTable", QueryType.Procedures);

            dt = OleDBHelper.ExecuteParamerizedSelectCommand(commandText, CommandType.Text, parameters);
            return(dt);
        }
Exemple #7
0
        public List <BooksMaster> SearchBooksMasterList(string searchText)
        {
            searchText = "%" + searchText + "%";
            List <BooksMaster> list = null;

            string commandText = OleDBHelper.GetQueryText("Search_BooksMaster", QueryType.Procedures);

            OleDbParameter[] parameters = new OleDbParameter[]
            {
                new OleDbParameter("@BookID", searchText),
                new OleDbParameter("@ISBN", searchText),
                new OleDbParameter("@Title]", searchText),
                new OleDbParameter("@Subject", searchText),
                new OleDbParameter("@Author", searchText),
                new OleDbParameter("@Publication", searchText)
                //new OleDbParameter("@EditionNo", searchText),
                //new OleDbParameter("@EditionYear", searchText)
                //new OleDbParameter("@Price", book.Price),
            };
            using (DataTable table = OleDBHelper.ExecuteParamerizedSelectCommand(commandText, CommandType.Text, parameters))
            {
                //check if any record exist or not
                if (table.Rows.Count > 0)
                {
                    //Lets go ahead and create the list of employees
                    list = new List <BooksMaster>();

                    //Now lets populate the employee details into the list of employees
                    foreach (DataRow row in table.Rows)
                    {
                        BooksMaster obj = new BooksMaster();

                        obj.BookID      = Convert.ToString(row["BookID"]);
                        obj.ISBN        = Convert.ToString(row["ISBN"]);
                        obj.Title       = Convert.ToString(row["Title"]);
                        obj.Subject     = Convert.ToString(row["Subject"]);
                        obj.Author      = Convert.ToString(row["Author"]);
                        obj.Publication = Convert.ToString(row["Publication"]);
                        obj.EditionNo   = Convert.ToInt32(row["EditionNo"]);
                        obj.EditionYear = Convert.ToInt32(row["EditionYear"]);
                        obj.Price       = Convert.ToInt32(row["Price"]);

                        list.Add(obj);
                    }
                }
            }

            return(list);
        }
Exemple #8
0
        public List <TransactionInDetails> GetTransactionInList(string transactionID)
        {
            List <TransactionInDetails> list = null;

            string commandText = OleDBHelper.GetQueryText("TransactionInDetails_SelectID", QueryType.Procedures);

            OleDbParameter[] parameters = new OleDbParameter[]
            {
                new OleDbParameter("@TransactionID", transactionID)
            };

            using (DataTable table = OleDBHelper.ExecuteParamerizedSelectCommand(commandText, CommandType.Text, parameters))
            {
                //check if any record exist or not
                if (table.Rows.Count > 0)
                {
                    //Lets go ahead and create the list of employees
                    list = new List <TransactionInDetails>();


                    ItemMaster itemHandler = new ItemMaster();
                    //Now lets populate the employee details into the list of employees
                    foreach (DataRow row in table.Rows)
                    {
                        TransactionInDetails obj = new TransactionInDetails();

                        obj.TransactionID = Convert.ToString(row["TransactionID"]);
                        obj.ItemMaster    = itemHandler.GetItemMasterDetails(Convert.ToString(row["ItemID"]));
                        obj.Unit          = Convert.ToInt32(row["Unit"]);
                        obj.Rate          = Convert.ToDecimal(Convert.IsDBNull(row["Rate"]) ? 0 : row["Rate"]);
                        obj.Amount        = Convert.ToDecimal(Convert.IsDBNull(row["Amount"]) ? 0 : row["Amount"]);
                        //obj.Subject = Convert.ToString(row["Subject"]);
                        //obj.Author = Convert.ToString(row["Author"]);
                        //obj.Publication = Convert.ToString(row["Publication"]);
                        //obj.EditionNo = Convert.ToInt32(row["EditionNo"]);
                        //obj.EditionYear = Convert.ToInt32(row["EditionYear"]);
                        //obj.Price = Convert.ToInt32(row["Price"]);
                        list.Add(obj);
                    }
                }
            }

            return(list);
        }
        //DataTable
        public DataTable GetReportTransactionIn(string transactionID)
        {
            DataTable dt = null;

            string commandText = OleDBHelper.GetQueryText("rptTransactionIn", QueryType.Procedures);

            OleDbParameter[] parameters = new OleDbParameter[]
            {
                new OleDbParameter("@TransactionID", transactionID)
            };

            using (DataTable table = OleDBHelper.ExecuteParamerizedSelectCommand(commandText, CommandType.Text, parameters))
            {
                //check if any record exist or not
                if (table.Rows.Count > 0)
                {
                    //Lets go ahead and create the list of employees
                    dt = new DataTable();

                    dt = table;
                }
            }
            return(dt);
        }