Example #1
0
        public bool SoSave()
        {
            if (false == CheckValues())
            {
                return(false);
            }
            So so = GetValues();

            if (!SoMgr.SaveSoMain(so))
            {
                MessageBox.Show("Save Sale Order Error!");
                return(false);
            }
            int soId = SoMgr.GetTheInsertId(so.salesId);

            //save an So number just for search
            SoMgr.SetSoNumber(soId);



            foreach (SoItemsContentAndState sics in soItemsStateList)
            {
                sics.soitem.soId = soId;
                AmbleClient.RfqGui.RfqManager.RfqMgr.ChangeRfqState(RfqStatesEnum.HasSO, sics.soitem.rfqId);
            }
            SoMgr.UpdateSoItems(soItemsStateList);
            MessageBox.Show("Save Sale Order Successfully");
            return(true);
        }
Example #2
0
 public SoView(So so)
 {
     InitializeComponent();
     soList = new List <So>();
     soList.Add(so);
     this.Text = "Info for SO:" + so.soId;
 }
Example #3
0
        public void SoSave()
        {
            if (false == CheckValues())
            {
                return;
            }
            So so = GetValues();

            if (!SoMgr.SaveSoMain(so))
            {
                MessageBox.Show("Save Sale Order Error!");
                return;
            }
            int soId = SoMgr.GetTheInsertId(so.salesId);

            foreach (SoItemsContentAndState sics in soItemsStateList)
            {
                sics.soitem.soId = soId;
            }
            SoMgr.UpdateSoItems(soItemsStateList);

            new AmbleClient.RfqGui.RfqManager.RfqMgr().ChangeRfqState(RfqStatesEnum.HasSO, rfqId);

            MessageBox.Show("Save Sale Order Successfully");
        }
Example #4
0
        public static void SaveSoDocx(So so, List <SoItemsContentAndState> soitemsList)
        {
            document = DocX.Load(@"SoDocx.dll");
            Formatting format = new Formatting();

            format.FontFamily = new System.Drawing.FontFamily("Arial");
            format.Size       = 9;
            Table soTable = document.Tables[0];

            soTable.Rows[0].Cells[1].Paragraphs[0].InsertText(so.customerName, false, format);
            soTable.Rows[0].Cells[3].Paragraphs[0].InsertText(Tool.Get6DigitalNumberAccordingToId(so.soId), false, format);
            soTable.Rows[1].Cells[3].Paragraphs[0].InsertText((so.orderDate.Year + "-" + so.orderDate.Month + "-" + so.orderDate.Day).ToString(), false, format);
            soTable.Rows[2].Cells[3].Paragraphs[0].InsertText(so.paymentTerm, false, format);
            soTable.Rows[3].Cells[1].Paragraphs[0].InsertText(so.contact, false, format);
            soTable.Rows[3].Cells[3].Paragraphs[0].InsertText(so.freightTerm, false, format);
            soTable.Rows[4].Cells[1].Paragraphs[0].InsertText(AllAccountInfo.GetNameAccordingToId(UserInfo.UserId), false, format);

            custvendorinfo custven = CustVenInfoManager.GetUniqueCustVenInfo(0, so.customerName, UserInfo.UserId);

            if (custven != null)
            {
                soTable.Rows[1].Cells[1].Paragraphs[0].InsertText(custven.phone1, false, format);
                soTable.Rows[2].Cells[1].Paragraphs[0].InsertText(custven.fax, false, format);
            }

            Table itemTable = document.Tables[1];

            if (soitemsList.Count > 2)
            {
                Row sampleRow = itemTable.Rows[2];
                for (int i = 0; i < soitemsList.Count - 2; i++)
                {
                    itemTable.InsertRow(sampleRow, 2);
                }
            }
            float totalAmount = 0;

            for (int i = 0; i < soitemsList.Count; i++)
            {
                itemTable.Rows[i + 2].Cells[0].Paragraphs[0].InsertText((i + 1).ToString(), false, format);
                itemTable.Rows[i + 2].Cells[1].Paragraphs[0].InsertText(soitemsList[i].soitem.partNo, false, format);
                itemTable.Rows[i + 2].Cells[2].Paragraphs[0].InsertText(soitemsList[i].soitem.mfg, false, format);
                itemTable.Rows[i + 2].Cells[3].Paragraphs[0].InsertText(soitemsList[i].soitem.qty.ToString(), false, format);
                // itemTable.Rows[i+2].Cells[4].InsertParagraph(soitemsList[i].soitem.
                if (soitemsList[i].soitem.currencyType == (int)Currency.USD)
                {
                    itemTable.Rows[i + 2].Cells[5].Paragraphs[0].InsertText(soitemsList[i].soitem.unitPrice.ToString(), false, format);
                    itemTable.Rows[i + 2].Cells[6].Paragraphs[0].InsertText((soitemsList[i].soitem.unitPrice * soitemsList[i].soitem.qty).ToString(), false, format);
                }
                else
                {
                    itemTable.Rows[i + 2].Cells[5].Paragraphs[0].InsertText(soitemsList[i].soitem.unitPrice.ToString() + Enum.GetName(typeof(Currency), soitemsList[i].soitem.currencyType), false, format);
                    itemTable.Rows[i + 2].Cells[6].Paragraphs[0].InsertText((soitemsList[i].soitem.unitPrice * soitemsList[i].soitem.qty).ToString() + Enum.GetName(typeof(Currency), soitemsList[i].soitem.currencyType), false, format);
                }
                totalAmount += soitemsList[i].soitem.unitPrice * soitemsList[i].soitem.qty;
            }
            itemTable.Rows[itemTable.Rows.Count - 1].Cells[4].Paragraphs[0].InsertText(totalAmount.ToString(), false, format);
            WriteToFile();
        }
Example #5
0
        /// <summary>
        /// Process a SO and change inventory levels.
        /// </summary>
        /// <returns>True/False when processed.</returns>
        public async Task <bool> SalesOrder(So so)
        {
            var rs = await this.context.ReadFabricsDb();

            rs.Fabrics.Where(u => u.Id == so.Id).Select(x => { x.Inventory -= so.Qty; return(rs.Fabrics); }).ToList();

            await this.context.WriteFabricsDb(rs);

            return(true);
        }
Example #6
0
 private void tsbCancel_Click(object sender, EventArgs e)
 {
     if (DialogResult.Yes == MessageBox.Show("Cancel SO?", "", MessageBoxButtons.YesNo))
     {
         So so = soList[tabControl1.SelectedIndex];
         SoMgr.WholeUpdateSoState(so.soId, UserInfo.UserId, SoStatesEnum.Cancel);
         this.DialogResult = DialogResult.Yes;
         this.Close();
     }
 }
Example #7
0
 private void tsbForceClose_Click(object sender, EventArgs e)
 {
     if (DialogResult.Yes == MessageBox.Show("Close SO and its all Items?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2))
     {
         So so = soList[tabControl1.SelectedIndex];
         SoMgr.WholeUpdateSoState(so.soId, UserInfo.UserId, SoStatesEnum.Closed);
         this.DialogResult = DialogResult.Yes;
         this.Close();
     }
 }
	public Sound( So manager )
	{
		_manager = manager;
		
		// Create a GameObject to hold the audioSource for playing sounds
		gameObject = new GameObject();
		gameObject.name = "empty";
		gameObject.transform.parent = manager.transform;
		
		audioSource = gameObject.AddComponent<AudioSource>();
	}
Example #9
0
    public Sound(So manager)
    {
        _manager = manager;

        // Create a GameObject to hold the audioSource for playing sounds
        gameObject                  = new GameObject();
        gameObject.name             = "empty";
        gameObject.transform.parent = manager.transform;

        audioSource = gameObject.AddComponent <AudioSource>();
    }
Example #10
0
        private void tsbToDocx_Click(object sender, EventArgs e)
        {
            So so = soList[tabControl1.SelectedIndex];
            List <SoItemsContentAndState> soItemStateList = soViewControlList[tabControl1.SelectedIndex].GetItemsStateList();

            if (UserInfo.Job == JobDescription.PurchasersManager || UserInfo.Job == JobDescription.Purchaser)
            {
                so.contact = "";
                if (UserInfo.Job == JobDescription.Purchaser)
                {
                    so.customerName = "";
                }
            }
            SoPoDocxHelper.SaveSoDocx(so, soItemStateList);
        }
Example #11
0
        public void SoUpdate()
        {
            if (false == CheckValues())
            {
                return;
            }
            So so = GetValues();

            if (!SoMgr.UpdateSoMain(so))
            {
                MessageBox.Show("Update Sale Order Error!");
                return;
            }

            MessageBox.Show("Update Sale Order Successfully");
        }
Example #12
0
        private void GenerateGui()
        {
            So so = soList[tabControl1.SelectedIndex];

            SoState soState = soStateList.GetSoStateAccordingToValue(so.soStates);

            if (soState.WhoCanUpdate().Contains(UserInfo.Job))
            {
                tsbUpdate.Enabled = true;
            }
            else
            {
                tsbUpdate.Enabled = false;
            }
            //for list
            tscbStateList.Items.Clear();
            List <Operation> opList = soState.GetOperationList();

            foreach (Operation op in opList)
            {
                if (op.jobs.Contains(UserInfo.Job))
                {
                    tscbStateList.Items.Add(op.operationName);
                }
            }
            //for enter PO
            if ((UserInfo.Job == JobDescription.Admin || UserInfo.Job == JobDescription.Boss || UserInfo.Job == JobDescription.PurchasersManager || UserInfo.Job == JobDescription.Purchaser) &&
                (so.soStates == new SoApprove().GetStateValue()))
            {
                tsbPoEnter.Enabled = true;
            }
            else
            {
                tsbPoEnter.Enabled = false;
            }
            //for view Po
            if (Order.PoMgr.PoMgr.GetPoNumberAccordingToSoId(soList[tabControl1.SelectedIndex].soId) <= 0)
            {
                tsbViewPo.Enabled = false;
            }
            else
            {
                tsbViewPo.Enabled = true;
            }
        }
Example #13
0
	void Awake()
	{
		// avoid duplicates
		if( und != null )
		{
			Destroy( gameObject );
			return;
		}
		
		und = this;
		DontDestroyOnLoad( gameObject );
		
		// Create the _soundList to speed up sound playing in game
		_soundList = new List<Sound>( initialCapacity );
		
		for( int i = 0; i < initialCapacity; i++ )
			_soundList.Add( new Sound( this ) );
	}
Example #14
0
    void Awake()
    {
        // avoid duplicates
        if (und != null)
        {
            Destroy(gameObject);
            return;
        }

        und = this;
        DontDestroyOnLoad(gameObject);

        // Create the _soundList to speed up sound playing in game
        _soundList = new List <Sound>(initialCapacity);

        for (int i = 0; i < initialCapacity; i++)
        {
            _soundList.Add(new Sound(this));
        }
    }
Example #15
0
        public void FillTheTable(So so)
        {
            this.soId         = so.soId;
            tbCustomer.Text   = so.customerName;
            tbContact.Text    = so.contact;
            tbSalesOrder.Text = so.salesOrderNo;
            if (so.approverId != null)
            {
                tbApprover.Text = new AmbleClient.Admin.AccountMgr.AccountMgr().GetNameById(so.approverId.Value);
            }
            if (so.approveDate != null)
            {
                tbApproveDate.Text = so.approveDate.Value.ToShortDateString();
            }
            dateTimePicker1.Value      = so.orderDate;
            tbCustomerPo.Text          = so.customerPo;
            tbPaymentTerm.Text         = so.paymentTerm;
            tbFreightTerm.Text         = so.freightTerm;
            tbCustomerAccount.Text     = so.customerAccount;
            tbSpecialInstructions.Text = so.specialInstructions;
            tbBillto.Text = so.billTo;
            tbShipTo.Text = so.shipTo;
            //Fill the sales ID
            FillTheSalesComboBox();

            cbSp.SelectedIndex = mySubs.IndexOf(so.salesId);



            foreach (SoItems item in SoMgr.GetSoItemsAccordingToSoId(so.soId))
            {
                this.soItemsStateList.Add(
                    new SoItemsContentAndState
                {
                    soitem = item,
                    state  = OrderItemsState.Normal
                }
                    );
            }
            ShowDataInDataGridView();
        }
Example #16
0
        private void tscbStateList_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (MessageBox.Show("Change the state to " + (string)tscbStateList.SelectedItem + "?", "warning", MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }

            string selectedItemString = (string)tscbStateList.SelectedItem;
            So     so = soList[tabControl1.SelectedIndex];

            SoState soState = soStateList.GetSoStateAccordingToValue(so.soStates);

            foreach (Operation op in soState.GetOperationList())
            {
                if (selectedItemString == op.operationName)
                {
                    op.operationMethod(so.soId);
                }
            }
            this.DialogResult = DialogResult.Yes;
        }
Example #17
0
        public static So GetLastData()
        {
            OpenConnection();
            var target = new So();
            var cmd    = new MySqlCommand();

            cmd.CommandText = "SELECT * FROM so";
            cmd.Connection  = cnx;

            MySqlDataReader dr = cmd.ExecuteReader();

            while (dr.Read())
            {
                target.SO_No        = dr.GetInt16("SO_No");
                target.Status_Rec   = dr.GetString("Status_Rec");
                target.SAP_No       = dr.GetInt16("SAP_No");
                target.Status       = dr.GetString("Status");
                target.Level_Impact = dr.GetString("Level_Impact");
                target.Service_Type = dr.GetString("Service_Type");
                target.CheckCosts   = dr.GetInt16("CheckCosts");
                target.D_System     = dr.GetDateTime("D_System");
                target.T_System     = dr.GetDateTime("T_System");
                target.D_Open       = dr.GetDateTime("D_Open");
                target.T_Open       = dr.GetDateTime("T_Open");
                target.Network_Type = dr.GetString("Network_Type");
                target.Eqt_Type     = dr.GetString("Eqt_Type");
                target.Node_ID      = dr.GetInt16("Node_ID");
                target.Node_Name    = dr.GetString("Node_Name");
                target.Sub_Area     = dr.GetString("Sub_Area");
                target.Remark       = dr.GetString("Remark");
                target.Open_By      = dr.GetString("Open_By");
            }

            CloseConnection();

            return(target);
        }
Example #18
0
        public void SoUpdate()
        {
            if (false == CheckValues())
            {
                return;
            }
            So so = GetValues();

            if (!SoMgr.UpdateSoMain(so))
            {
                MessageBox.Show("Update Sale Order Error!");
                return;
            }

            SoMgr.UpdateSoItems(soItemsStateList);

            foreach (SoItemsContentAndState sics in deletedList)
            {
                SoMgr.DeleteSoItembySoItemId(sics.soitem.soItemsId);
            }


            MessageBox.Show("Update Sale Order Successfully");
        }
Example #19
0
        public async Task <IActionResult> So([FromBody] So so)
        {
            var rs = await this.inventoryService.SalesOrder(so);

            return(Ok(rs));
        }
Example #20
0
        static void FillTheSoSheet(ISheet sheet, So so, List <SoItemsContentAndState> soitemList)
        {
            AmbleClient.Admin.AccountMgr.AccountMgr accMgr = new Admin.AccountMgr.AccountMgr();
            sheet.GetRow(0).CreateCell(2).SetCellValue(so.customerName);
            sheet.GetRow(0).CreateCell(6).SetCellValue(so.contact);
            sheet.GetRow(0).CreateCell(9).SetCellValue(accMgr.GetNameById(so.salesId));

            if (so.approverId != null)
            {
                sheet.GetRow(0).CreateCell(14).SetCellValue(accMgr.GetNameById(so.approverId.Value) + "," + so.approveDate.Value.ToShortDateString());
            }
            sheet.GetRow(1).CreateCell(2).SetCellValue(so.salesOrderNo);
            sheet.GetRow(1).CreateCell(6).SetCellValue(so.orderDate.ToShortDateString());

            sheet.GetRow(1).CreateCell(9).SetCellValue(so.customerPo);
            sheet.GetRow(1).CreateCell(14).SetCellValue(so.paymentTerm);

            sheet.GetRow(2).CreateCell(2).SetCellValue(so.freightTerm);
            sheet.GetRow(2).CreateCell(6).SetCellValue(so.customerAccount);
            sheet.GetRow(2).CreateCell(9).SetCellValue(so.specialInstructions);

            IRow row = sheet.CreateRow(4);

            row.CreateCell(0).SetCellValue(so.billTo);
            row.CreateCell(8).SetCellValue(so.shipTo);

            int itemRowIndex = 9;

            foreach (SoItemsContentAndState scs in soitemList)
            {
                IRow itemRow = sheet.CreateRow(itemRowIndex);
                itemRow.CreateCell(0).SetCellValue(soitemList.IndexOf(scs) + 1);
                string strSaleType;
                switch (scs.soitem.saleType)
                {
                case 0:

                    strSaleType = "OEM EXCESS";
                    break;

                case 1:
                    strSaleType = "OWN STOCK";
                    break;

                case 2:
                    strSaleType = "OTHERS";
                    break;

                default:
                    strSaleType = "ERROR";
                    break;
                }

                itemRow.CreateCell(1).SetCellValue(strSaleType);
                itemRow.CreateCell(2).SetCellValue(scs.soitem.partNo);
                itemRow.CreateCell(3).SetCellValue(scs.soitem.mfg);
                itemRow.CreateCell(4).SetCellValue(scs.soitem.rohs == 1 ? "Y" : "N");
                itemRow.CreateCell(5).SetCellValue(scs.soitem.dc);
                itemRow.CreateCell(6).SetCellValue(scs.soitem.intPartNo);
                itemRow.CreateCell(7).SetCellValue(scs.soitem.shipFrom);
                itemRow.CreateCell(8).SetCellValue(scs.soitem.shipMethod);
                itemRow.CreateCell(9).SetCellValue(scs.soitem.trackingNo);
                itemRow.CreateCell(10).SetCellValue(scs.soitem.qty);
                itemRow.CreateCell(11).SetCellValue(scs.soitem.qtyshipped);
                itemRow.CreateCell(12).SetCellValue(Enum.GetName(typeof(AmbleClient.Currency), scs.soitem.currencyType));
                itemRow.CreateCell(13).SetCellValue(scs.soitem.unitPrice);
                itemRow.CreateCell(14).SetCellValue(scs.soitem.unitPrice * scs.soitem.qty);
                itemRow.CreateCell(15).SetCellValue(scs.soitem.dockDate.ToShortDateString());

                if (scs.soitem.shippedDate != null)
                {
                    itemRow.CreateCell(16).SetCellValue(scs.soitem.shippedDate.Value.ToShortDateString());
                }
                itemRowIndex++;

                IRow infoRow = sheet.CreateRow(itemRowIndex);
                infoRow.CreateCell(1).SetCellValue("Shipping Instructions >>" + scs.soitem.shippingInstruction);
                sheet.AddMergedRegion(new NPOI.SS.Util.CellRangeAddress(itemRowIndex, itemRowIndex, 1, 16));


                itemRowIndex++;
                infoRow = sheet.CreateRow(itemRowIndex);
                infoRow.CreateCell(1).SetCellValue("Packing Instructions >>" + scs.soitem.packingInstruction);
                sheet.AddMergedRegion(new NPOI.SS.Util.CellRangeAddress(itemRowIndex, itemRowIndex, 1, 16));
                itemRowIndex++;
            }
        }
Example #21
0
        public So SaveData(
            int SO_No,
            string Status_Rec,
            int SAP_No,
            string Status,
            string Level_Impact,
            string Service_Type,
            int CheckCosts,
            DateTime D_System,
            DateTime T_System,
            DateTime D_Open,
            DateTime T_Open,
            string Network_Type,
            string Eqt_Type,
            int Node_ID,
            string Node_Name,
            string Sub_Area,
            string Remark,
            string Open_By
            )
        {
            OpenConnection();
            var target = new So();
            var cmd    = new MySqlCommand();

            cmd.CommandText = @"INSERT INTO so (Status_Rec,SAP_No,Status,Level_Impact,Service_Type,CheckCosts,D_System,T_System,D_Open,T_Open,Network_Type,Eqt_Type,Node_ID,Node_Name,Sub_Area,Remark,Open_By)
                                VALUES
                                (
                                    @Status_Rec,
                                    @SAP_No,
                                    @Status,
                                    @Level_Impact,
                                    @Service_Type,
                                    @CheckCosts,
                                    @D_System,
                                    @T_System,
                                    @D_Open,
                                    @T_Open,
                                    @Network_Type,
                                    @Eqt_Type,
                                    @Node_ID,
                                    @Node_Name,
                                    @Sub_Area,
                                    @Remark,
                                    @Open_By 
                                );";
            cmd.Connection  = cnx;
            cmd.Parameters.AddWithValue("@Status_Rec", Status_Rec);
            cmd.Parameters.AddWithValue("@SAP_No", SAP_No);
            cmd.Parameters.AddWithValue("@Status", Status);
            cmd.Parameters.AddWithValue("@Level_Impact", Level_Impact);
            cmd.Parameters.AddWithValue("@Service_Type", Service_Type);
            cmd.Parameters.AddWithValue("@CheckCosts", CheckCosts);
            cmd.Parameters.AddWithValue("@D_System", D_System);
            cmd.Parameters.AddWithValue("@T_System", T_System);
            cmd.Parameters.AddWithValue("@D_Open", D_Open);
            cmd.Parameters.AddWithValue("@T_Open", T_Open);
            cmd.Parameters.AddWithValue("@Network_Type", Network_Type);
            cmd.Parameters.AddWithValue("@Eqt_Type", Eqt_Type);
            cmd.Parameters.AddWithValue("@Node_ID", Node_ID);
            cmd.Parameters.AddWithValue("@Node_Name", Node_Name);
            cmd.Parameters.AddWithValue("@Sub_Area", Sub_Area);
            cmd.Parameters.AddWithValue("@Remark", Remark);
            cmd.Parameters.AddWithValue("@Open_By", Open_By);
            cmd.ExecuteNonQuery();
            //MySqlDataReader dr = cmd.ExecuteReader();
            CloseConnection();

            return(GetLastRequest());
        }
Example #22
0
        private void GenerateGui()
        {
            So so = soList[tabControl1.SelectedIndex];

            //for view Po
            if (Order.PoMgr.PoMgr.GetPoNumberAccordingToSoId(soList[tabControl1.SelectedIndex].soId) <= 0)
            {
                tsbViewPo.Enabled = false;
            }
            else
            {
                tsbViewPo.Enabled = true;
            }

            //for approve and rejected.
            if (so.soStates == (int)SoStatesEnum.New)
            {
                tsbApprove.Enabled = true;
                tsbReject.Enabled  = true;
            }
            else
            {
                tsbApprove.Enabled = false;
                tsbReject.Enabled  = false;
            }
            //for cancel

            if (so.soStates == (int)SoStatesEnum.Approved)
            {
                tsbCancel.Enabled = true;
            }
            else
            {
                tsbCancel.Enabled = false;
            }

            if (UserInfo.Job == JobDescription.Admin || UserInfo.Job == JobDescription.Boss)
            {
                tsbForceClose.Enabled = true;
            }
            else
            {
                tsbForceClose.Enabled = false;
            }

            if (so.soStates != (int)SoStatesEnum.New && UserCombine.GetUserCanBeSalesManager().Contains((int)UserInfo.Job))
            {
                tsbUpdate.Enabled = true;
            }
            else if (so.soStates == (int)SoStatesEnum.New && UserCombine.GetUserCanBeSales().Contains((int)UserInfo.Job))
            {
                tsbUpdate.Enabled = true;
            }
            else
            {
                tsbUpdate.Enabled = false;
            }

            if (!UserCombine.GetUserCanBeSalesManager().Contains((int)UserInfo.Job))
            {
                tsbApprove.Enabled    = false;
                tsbReject.Enabled     = false;
                tsbForceClose.Enabled = false;
                tsbCancel.Enabled     = false;
            }
        }
Example #23
0
 public SoView(So so)
 {
     InitializeComponent();
     soList = new List <So>();
     soList.Add(so);
 }
Example #24
0
        public void FillTheTable(So so, int?selectedItem)
        {
            this.soId = so.soId;

            this.selectedSoItemId = selectedItem;
            this.isNewCreateSo    = false;

            if (UserInfo.Job == JobDescription.Purchaser)
            {
                tbCustomer.Text = "";
            }
            else
            {
                tbCustomer.Text = so.customerName;
            }



            if (UserInfo.Job == JobDescription.Purchaser || UserInfo.Job == JobDescription.PurchasersManager)
            {
                tbContact.Text = "";
            }
            else
            {
                tbContact.Text = so.contact;
            }
            tbSalesOrder.Text = Tool.Get6DigitalNumberAccordingToId(so.soId);
            if (so.approverId != null)
            {
                tbApprover.Text = AmbleClient.Admin.AccountMgr.AccountMgr.GetNameById(so.approverId.Value);
            }
            if (so.approveDate != null)
            {
                tbApproveDate.Text = so.approveDate.Value.ToShortDateString();
            }
            dateTimePicker1.Value      = so.orderDate;
            tbCustomerPo.Text          = so.customerPo;
            tbPaymentTerm.Text         = so.paymentTerm;
            tbFreightTerm.Text         = so.freightTerm;
            tbCustomerAccount.Text     = so.customerAccount;
            tbSpecialInstructions.Text = so.specialInstructions;
            tbBillto.Text = so.billTo;
            tbShipTo.Text = so.shipTo;
            //Fill the sales ID

            FillTheSalesComboBox();
            if (mySubs.Contains(so.salesId))
            {
                cbSp.SelectedIndex = mySubs.IndexOf(so.salesId);
            }
            else
            {
                cbSp.Items.Clear();
                cbSp.Items.Add(Admin.AccountMgr.AccountMgr.GetNameById(so.salesId));
                cbSp.SelectedIndex = 0;
            }


            GetSoItems();

            ShowDataInDataGridView();


            if (mySubs.Contains(so.salesId))
            {
                btAdd.Enabled    = true;
                btDelete.Enabled = true;
                btSplit.Enabled  = true;
            }
            else
            {
                btAdd.Enabled    = false;
                btDelete.Enabled = false;
                btSplit.Enabled  = false;
            }

            if (so.soStates != (int)SoStatesEnum.New)
            {
                btAdd.Enabled = false;
            }
            else
            {
                btAdd.Enabled = true;
            }
        }
Example #25
0
 public override string ToString()
 {
     return(Ten + So.ToString());
 }
Example #26
0
 /// <summary>
 /// Process a SO and change inventory levels.
 /// </summary>
 /// <returns>True/False when processed.</returns>
 public async Task <bool> SalesOrder(So so)
 {
     return(await this.inventoryRepository.SalesOrder(so));
 }