示例#1
0
        private void Save()
        {
            bool        result = false;
            BooksMaster book   = GetBook();


            BooksMasterHandler handler = new BooksMasterHandler();

            if (AddMode)
            {
                result = handler.AddNewBooksMaster(book);
                if (result)
                {
                    result = GlobalFunction.UpdateUniqueCode("BooksMaster");
                }
            }
            else if (EditMode)
            {
                result = handler.UpdateBooksMaster(book);
            }


            if (result == true)
            {
                MessageBox.Show("New Account created");
            }
            else
            {
                MessageBox.Show("Errror Occurs!");
            }
        }
示例#2
0
        private void Save()
        {
            bool result = false;
            BooksTransactionOutMaster objOutMaster = GetTransactionOutMasterInterface();


            List <BooksTransactionOutDetails> objDetailsList = GetTransactionInDetailsOutiterface();
            BooksTransactionOutDetails        objDetails     = new BooksTransactionOutDetails();

            if (AddMode)
            {
                result = objOutMaster.AddNewTransactionOutMaster(objOutMaster);

                if (result)
                {
                    result = objDetails.AddNewTransactionOutDetails(objDetailsList);
                }
                if (result)
                {
                    result = GlobalFunction.UpdateUniqueCode("BooksTransactionOutMaster");
                }
            }
            else if (EditMode)
            {
                result = objOutMaster.UpdateTransactionOutMaster(objOutMaster);
                if (result)
                {
                    result = objDetails.DeleteTransactionOutMaster(objOutMaster.TransactionID);

                    if (result)
                    {
                        result = objDetails.AddNewTransactionOutDetails(objDetailsList);
                    }
                }
            }

            if (result == true)
            {
                if (AddMode)
                {
                    MessageBox.Show("New Record added successfully");
                }
                else
                {
                    MessageBox.Show("Record updated successfully");
                }

                ControlStatus(true);
            }
            else
            {
                MessageBox.Show("Errror Occurs!");
            }
        }
示例#3
0
        private void Save()
        {
            bool        result = false;
            BooksMaster book   = GetBook();


            BooksMasterHandler handler = new BooksMasterHandler();

            if (AddMode)
            {
                result = handler.AddNewBooksMaster(book);
                if (result)
                {
                    result = GlobalFunction.UpdateUniqueCode("BooksMaster");
                }
            }
            else if (EditMode)
            {
                result = handler.UpdateBooksMaster(book);
            }

            if (result == true)
            {
                if (AddMode)
                {
                    MessageBox.Show("New Record added successfully");
                }
                else
                {
                    MessageBox.Show("Record is updated successfully");
                }

                ControlStatus(true);
            }
            else
            {
                MessageBox.Show("Errror Occurs!");
            }
        }
        private void Save()
        {
            bool result = false;
            BooksTransactionInMaster        objBooksTransactionInMaster = GetTransactionInMasterInterface();
            BooksTransactionInMasterHandler masterhandler = new BooksTransactionInMasterHandler();

            List <BooksTransactionInDetails> objDetailsList    = GetTransactionInDetailsInterface();
            BooksTransactionInDetailsHandler objDetailsHandler = new BooksTransactionInDetailsHandler();

            if (AddMode)
            {
                result = masterhandler.AddNewTransactionInMaster(objBooksTransactionInMaster);

                if (result)
                {
                    result = objDetailsHandler.AddNewTransactionInDetails(objDetailsList);
                }
                if (result)
                {
                    result = GlobalFunction.UpdateUniqueCode("BooksTransactionInMaster");
                }
            }
            else if (EditMode)
            {
                result = masterhandler.UpdateTransactionIn(objBooksTransactionInMaster);
            }

            if (result == true)
            {
                MessageBox.Show("Data Added Successfully");
            }
            else
            {
                MessageBox.Show("Errror Occurs!");
            }

            ControlStatus(true);
        }
        private void Save()
        {
            bool result = false;
            BooksTransactionInMaster        objBooksTransactionInMaster = GetTransactionInMasterInterface();
            BooksTransactionInMasterHandler masterhandler = new BooksTransactionInMasterHandler();

            List <BooksTransactionInDetails> objDetailsList    = GetTransactionInDetailsInterface();
            BooksTransactionInDetailsHandler objDetailsHandler = new BooksTransactionInDetailsHandler();

            Inventory obj;

            if (AddMode)
            {
                result = masterhandler.AddNewTransactionInMaster(objBooksTransactionInMaster);

                if (result)
                {
                    result = objDetailsHandler.AddNewTransactionInDetails(objDetailsList);
                }
                if (result)
                {
                    result = GlobalFunction.UpdateUniqueCode("BooksTransactionInMaster");
                }

                obj = new Inventory();
                if (result)
                {
                    result = obj.AddInventory(objDetailsList);
                }
            }
            else if (EditMode)
            {
                obj = new Inventory();

                result = masterhandler.UpdateTransactionIn(objBooksTransactionInMaster);

                if (result)
                {
                    result = obj.UpdateInventory(objBooksTransactionInMaster.TransactionID, objDetailsList);
                }

                if (result)
                {
                    result = objDetailsHandler.DeleteTransactionInDetails(objBooksTransactionInMaster.TransactionID);

                    if (result)
                    {
                        result = objDetailsHandler.AddNewTransactionInDetails(objDetailsList);
                    }
                }
            }

            if (result == true)
            {
                if (AddMode)
                {
                    MessageBox.Show("New Record added successfully");
                }
                else
                {
                    MessageBox.Show("Record updated successfully");
                }

                ControlStatus(true);
            }
            else
            {
                MessageBox.Show("Errror Occurs!");
            }
        }