Ejemplo n.º 1
0
        private void btnSaveUpdate_Click(object sender, EventArgs e)
        {
            array_daily[updatnumber].bincode  = txtEditBinCode.Text;
            array_daily[updatnumber].quantity = txtEditQty.Text;

            GrdDailyLoss.DataSource = null;
            dt.Clear();

            //for (int i = 0; i < array_daily.Count; i++)
            //{
            //    Object[] array = new Object[6];

            //    array[0] = array_daily[i].itemno;
            //    array[1] = array_daily[i].location;
            //    array[2] = array_daily[i].bincode;
            //    array[3] = array_daily[i].quantity;
            //    array[4] = array_daily[i].postingDate;
            //    array[5] = array_daily[i].staffdimension;

            //    dt.Rows.Add(array);

            //}

            CompactSQL comsql = new CompactSQL();

            comsql.updateDailyLoss(Convert.ToInt32(txtEditQty.Text.ToString()), Convert.ToInt32(txtLineNo.Text.ToString()));

            getdata = comsql.SelectRecord("DailyLoss");
            GetSQLData(getdata);

            //GrdDailyLoss.DataSource = dt;

            MessageBox.Show("Updated Succesfully!");
        }
Ejemplo n.º 2
0
        public DailyLoss(string userd, string staffd, string uleveld)
        {
            InitializeComponent();
            staffdim  = staffd;
            username  = userd;
            userlevel = uleveld;
            array_daily.Clear();
            dt.Clear();

            txtBinCode.Focus();
            //txtQuantity.Enabled = false;
            dt.Columns.Add(new DataColumn("Posting Date"));
            dt.Columns.Add(new DataColumn("Item No."));
            dt.Columns.Add(new DataColumn("Location"));
            dt.Columns.Add(new DataColumn("Quantity"));
            dt.Columns.Add(new DataColumn("Bin Code"));
            dt.Columns.Add(new DataColumn("Staff Dimsn"));
            dt.Columns.Add(new DataColumn("LineNo"));
            dt.Columns.Add(new DataColumn("EmptyTank"));

            // MnuNewGRN.Enabled = false;
            lblStaffName.Text = staffd + "/Role:" + uleveld;
            Main.Show();
            st = DateTime.Now.ToString("ddMMyyyy");


            CompactSQL comsql = new CompactSQL();

            getdata = comsql.SelectRecord("DailyLoss");
            GetSQLData(getdata);
        }
Ejemplo n.º 3
0
        private void deleteCurrentRow()
        {
            bool isFound = false;

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    //if ((dt.Rows[i][0].ToString() == GrdDailyLoss[GrdDailyLoss.CurrentCell.RowNumber, 0].ToString()) &&
                    //    (dt.Rows[i][1].ToString() == GrdDailyLoss[GrdDailyLoss.CurrentCell.RowNumber, 1].ToString()) &&
                    //    (dt.Rows[i][2].ToString() == GrdDailyLoss[GrdDailyLoss.CurrentCell.RowNumber, 2].ToString()) &&
                    //    (dt.Rows[i][3].ToString() == GrdDailyLoss[GrdDailyLoss.CurrentCell.RowNumber, 3].ToString()) &&
                    //    (dt.Rows[i][5].ToString() == GrdDailyLoss[GrdDailyLoss.CurrentCell.RowNumber, 4].ToString()) &&
                    //    !isFound)
                    if ((dt.Rows[i][6].ToString() == GrdDailyLoss[GrdDailyLoss.CurrentCell.RowNumber, 6].ToString()) &&
                        !isFound)
                    {
                        CompactSQL comsql = new CompactSQL();
                        comsql.deleteRecordLine("DailyLoss", Convert.ToInt32(GrdDailyLoss[GrdDailyLoss.CurrentCell.RowNumber, 6].ToString().Trim()));
                        dt.Rows.RemoveAt(i);
                        array_daily.RemoveAt(i);

                        getdata = comsql.SelectRecord("DailyLoss");
                        GetSQLData(getdata);

                        isFound = true;
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public DailyLossTS(string usname, string staffdimen, string uslevel, List <DailyLossFormTS> rebindArray, DailyLossFormTS currentControl)
        {
            try
            {
                InitializeComponent();
                staffname  = usname;
                stafflevel = uslevel;
                staffdim   = staffdimen;

                string[] tempstr = currentControl.itemno.Split('~');

                txtItemNo.Text            = tempstr[0].ToString();
                txtBinCode.Text           = currentControl.bincode;
                txtLocation.Text          = currentControl.location;
                cboEntryType.SelectedItem = currentControl.entrytype;
                txtPostingDate.Text       = currentControl.postdate.ToString();
                txtQuantity.Text          = currentControl.quantity;
                txtDescription.Text       = tempstr[1].ToString();

                lblStaffName.Text = staffdim + "/Role:" + uslevel;

                RebindToGrid(rebindArray);

                CompactSQL comsql = new CompactSQL();
                getdata = comsql.SelectRecord("ChangeSize");
                GetSQLData(getdata);
                ///
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 5
0
        private void ExportStockTakeTableToXML()
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                CompactSQL      comsql = new CompactSQL();
                SqlCeDataReader lgetdata;
                lgetdata = comsql.SelectRecord("StockTakeEntry");
                //if (lgetdata[0] != DBNull.Value)
                //{
                string ApplicationPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);
                ApplicationPath = ApplicationPath + "\\Stocktake.xml";
                if (File.Exists(ApplicationPath))
                {
                    File.Delete(ApplicationPath);
                }
                DataSet   ds = new DataSet();
                DataTable dt = ds.Tables.Add();
                dt.Load(lgetdata);
                ds.WriteXml(ApplicationPath);
                MessageBox.Show("Backup Successfully");

                //StreamReader streamReader = File.OpenText(ApplicationPath);
                //string xmlString = streamReader.ReadToEnd().ToString();
                //streamReader.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            Cursor.Current = Cursors.Default;
        }
Ejemplo n.º 6
0
        private void menuItem3_Click(object sender, EventArgs e)
        {
            try
            {
                dt.Clear();

                Cursor.Current = Cursors.WaitCursor;
                StockTake stk = new StockTake(uname, staffdim, ulevel);
                stk.Show();
                dgGRNLine.DataSource = null;
                menuValue            = "2";
                txtBin.Enabled       = true;
                txtBin.Focus();

                CompactSQL comsql = new CompactSQL();
                getdata = comsql.SelectRecord("StockTakeEntry");
                GetSQLData(getdata);

                MessageBox.Show("You have choosen Opening Balance Option.");

                Cursor.Current = Cursors.Default;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error" + ex);
            }
        }
Ejemplo n.º 7
0
        public PurChaseOrder(string vname, string vno, string usng, string staffdimg, string uslvelg)
        {
            InitializeComponent();
            PoArray.Clear();
            dt.Clear();

            vNumber         = vno;
            vName           = vname;
            vuser           = usng;
            vstaffdimension = staffdimg;
            vstafflevel     = uslvelg;

            txtVendorNo.Text   = vNumber;
            txtVendorName.Text = vName;
            txtRegDate.Text    = DateTime.Now.ToString("dd/MM/yyyy");
            txtLocation.Text   = "QH1";

            dt.Columns.Add("Item No");
            dt.Columns.Add("Item Description");
            dt.Columns.Add("Location");
            dt.Columns.Add("Quantity");
            dt.Columns.Add("LineNo");

            txtItemNo.Focus();

            //load from SQL
            //
            CompactSQL comsql = new CompactSQL();

            getdata = comsql.SelectRecord("PurchaseOrder");
            GetSQLData(getdata, false);
        }
Ejemplo n.º 8
0
        public StockTake(string username, string staffdim, string userlevel)
        {
            InitializeComponent();
            stmod = new List <QHMobile.App_Data.STModule>();
            stmod.Clear();
            dt = new DataTable("ST_Table");
            dt.Clear();
            dt.Rows.Clear();

            dgGRNLine.DataSource = null;
            dgGRNLine.Refresh();

            dt.Columns.Add(new DataColumn("ItemNo"));
            dt.Columns.Add(new DataColumn("BinNo"));
            dt.Columns.Add(new DataColumn("Qty"));
            dt.Columns.Add(new DataColumn("Posting_Date"));     // Stock take date
            dt.Columns.Add(new DataColumn("Staff_Name"));
            //dt.Columns.Add(new DataColumn("Entry_Date"));
            dt.Columns.Add(new DataColumn("Category"));
            dt.Columns.Add(new DataColumn("Lineno"));
            //txtBin.Focus();
            this.staffdim = staffdim;
            this.uname    = username;
            this.ulevel   = userlevel;

            CompactSQL comsql = new CompactSQL();

            getdata = comsql.SelectRecord("StockTakeEntry");
            GetSQLData(getdata);
        }
Ejemplo n.º 9
0
        public DailyLossTS(string usname, string staffdimen, string uslevel)
        {
            InitializeComponent();
            try
            {
                staffdim   = staffdimen;
                staffname  = usname;
                stafflevel = uslevel;

                dl_array.Clear();
                dt.Clear();
                dtpost.Clear();
                GrdDailyLoss.DataSource = null;

                lblStaffName.Text = staffdim + "/Role:" + uslevel;
                count             = 0;
                dt.Columns.Add("Item No");
                dt.Columns.Add("Description");
                dt.Columns.Add("EntryType");
                dt.Columns.Add("Location");
                dt.Columns.Add("Bin Code");
                dt.Columns.Add("Quantity");
                dt.Columns.Add("StaffDimension");
                dt.Columns.Add("PostingDate");
                dt.Columns.Add("LineNo");
                dt.Columns.Add("EmptyTank");


                dtpost.Columns.Add("Item No");
                dtpost.Columns.Add("Location");
                dtpost.Columns.Add("Bin Code");
                dtpost.Columns.Add("Entry Type");
                dtpost.Columns.Add("Quantity");
                BindToPost();

                CompactSQL comsql = new CompactSQL();
                getdata = comsql.SelectRecord("ChangeSize");
                GetSQLData(getdata);


                if (uslevel.Equals("Super"))
                {
                    tbDL.Show();

                    menuItem1.Enabled = true;
                }
                else
                {
                    tbDL.Show();
                    menuItem1.Enabled = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 10
0
        private void btnConfirmUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;

                PoArray[updatnumber].location = txtEditLocation.Text;
                PoArray[updatnumber].quantity = txtEditQuantity.Text;


                GrdPO.DataSource = null;
                dt.Clear();
                for (int i = 0; i < PoArray.Count; i++)
                {
                    Object[] array = new Object[4];

                    array[0] = PoArray[i].itemno;
                    array[1] = PoArray[i].itemDescription;
                    array[2] = PoArray[i].location;
                    array[3] = PoArray[i].quantity;

                    dt.Rows.Add(array);
                }
                Object[] arraySQLUpdate = new Object[2];
                arraySQLUpdate[0] = txtEditLocation.Text;
                arraySQLUpdate[1] = Convert.ToInt32(txtEditQuantity.Text.Trim());
                CompactSQL comsql = new CompactSQL();
                comsql.updatePOLine(arraySQLUpdate, Convert.ToInt32(txtLineno.Text));

                //CompactSQL comsql = new CompactSQL();
                getdata = comsql.SelectRecord("PurchaseOrder");
                GetSQLData(getdata, false);

                //GrdPO.DataSource = dt;
                Cursor.Current = Cursors.Default;
                MessageBox.Show("Updated Succesfully!");
            }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 11
0
        public PurChaseOrder(string usng, string staffdimg, string uslvelg)
        {
            InitializeComponent();
            PoArray.Clear();
            dt.Clear();

            txtRegDate.Text = DateTime.Now.ToString("dd/MM/yyyy");
            vuser           = usng;
            vstaffdimension = staffdimg;
            vstafflevel     = uslvelg;


            dt.Columns.Add("Item No");
            dt.Columns.Add("Item Description");
            dt.Columns.Add("Location");
            dt.Columns.Add("Quantity");
            dt.Columns.Add("LineNo");

            CompactSQL comsql = new CompactSQL();

            getdata = comsql.SelectRecord("PurchaseOrder");
            GetSQLData(getdata, true);
        }
Ejemplo n.º 12
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                if (!string.IsNullOrEmpty(txtItemNo.Text.Trim()) && !string.IsNullOrEmpty(txtFromBin.Text.Trim()) && !string.IsNullOrEmpty(txtToBin.Text.Trim()))
                //if (!txtItemNo.Text.Equals("") && !txtFromBin.Text.Equals("") && !txtToBin.Text.Equals(""))
                {
                    ItemQH.ItemQH_Service iqhservice = new QHMobile.ItemQH.ItemQH_Service();
                    iqhservice.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);
                    iqhservice.Credentials = nc;
                    ItemQH.ItemQH iqh = iqhservice.Read(txtItemNo.Text.Trim());

                    if (iqh != null)
                    {
                        BinQH.BinQH_Service binServ = new QHMobile.BinQH.BinQH_Service();
                        binServ.Url         = WebServiceInstants.GetURL(ServiceType.BinQH);
                        binServ.Credentials = nc;

                        BinQH.BinQH tobinqh = binServ.Read(lblInfoLocation.Text.ToString(), txtToBin.Text.Trim());
                        if (tobinqh != null)
                        {
                            if (tobinqh.Block_Movement == QHMobile.BinQH.Block_Movement.All)
                            {
                                MessageBox.Show("To Bin is Blocked");
                                txtToBin.SelectAll();
                                txtToBin.Focus();
                            }
                            else
                            {
                                bool flag = GotoBinvalidation();

                                if (flag == true)
                                {
                                    InsertLines();

                                    CompactSQL comsql = new CompactSQL();         //test3

                                    getdata = comsql.SelectRecord("ItemReclass"); //test3
                                    GetSQLData(getdata);                          //test3

                                    //BindTOGrid();
                                    Cursor.Current = Cursors.Default;

                                    txtFromBin.Text         = "";
                                    txtToBin.Text           = "";
                                    textBox1.Text           = "";
                                    txtItemNo.Text          = "";
                                    txtFishDescription.Text = "";
                                    lblInfoLocation.Text    = "";
                                    chkEmpty.Checked        = false;
                                    txtFromBin.Focus();
                                }
                                else
                                {
                                    MessageBox.Show("You are not allowed to put into the bin with different item!Fish Description: " + fishdescription);
                                    txtToBin.SelectAll();
                                    txtToBin.Focus();
                                }
                            }
                        }
                        // }
//////here
                    }
                    else
                    {
                        MessageBox.Show("Invalid Item No!");
                    }
                }
                else
                {
                    MessageBox.Show("All field are required to enter.");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            Cursor.Current = Cursors.Default;
        }
Ejemplo n.º 13
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                if (cboEntryType.SelectedText.Equals("Positive Adjmt.") && chkEmpty.Checked == true)
                {
                    MessageBox.Show("PDA: You cannot now allow to empty the bin in positive state.");
                }
                else
                {
                    if (count == 0)
                    {
                        if (!string.IsNullOrEmpty(txtItemNo.Text.Trim()) && !string.IsNullOrEmpty(txtBinCode.Text.Trim()) && !string.IsNullOrEmpty(txtLocation.Text.Trim()) && !string.IsNullOrEmpty(txtQuantity.Text.Trim()) && !txtQuantity.Text.Trim().Equals("0"))
                        //if (!txtItemNo.Text.Equals("") && !txtBinCode.Text.Equals("") && !txtLocation.Text.Equals("") && !txtQuantity.Text.Equals(""))
                        {
                            bool isNum = IsItNumber(txtQuantity.Text.Trim());

                            if (isNum)
                            {
                                bool flagLocation = LocationValidating();

                                bool flagItem = ItemValidating();

                                if (flagLocation == true && flagItem == true)
                                {
                                    DailyLossFormTS insert = new DailyLossFormTS();
                                    Object[]        array  = new Object[9];

                                    insert.itemno         = txtItemNo.Text.Trim();
                                    array[0]              = txtItemNo.Text.Trim();
                                    insert.entrytype      = cboEntryType.Text.Trim();
                                    array[1]              = txtDescription.Text.Trim();
                                    insert.description    = txtDescription.Text.Trim();
                                    array[2]              = cboEntryType.Text.Trim();
                                    insert.location       = txtLocation.Text.Trim();
                                    array[3]              = txtLocation.Text.Trim();
                                    insert.bincode        = txtBinCode.Text.Trim();
                                    array[4]              = txtBinCode.Text.Trim();
                                    insert.quantity       = txtQuantity.Text.Trim();
                                    array[5]              = txtQuantity.Text.Trim();
                                    insert.staffdimension = staffdim;
                                    array[6]              = staffdim;
                                    insert.postdate       = txtPostingDate.Text.Trim();
                                    array[7]              = Convert.ToDateTime(txtPostingDate.Text.Trim());
                                    if (chkEmpty.Checked)
                                    {
                                        array[8] = true;
                                    }
                                    else
                                    {
                                        array[8] = false;
                                    }
                                    dl_array.Add(insert);
                                    dt.Rows.Add(array);
                                    lblCount.Text = dt.Rows.Count.ToString();

                                    //tempthu
                                    CompactSQL comsql = new CompactSQL();
                                    comsql.InsertRecord("ChangeSize", array);

                                    getdata = comsql.SelectRecord("ChangeSize"); //test3
                                    GetSQLData(getdata);                         //test3
                                    CallBindGrid();
                                    //tempthu
                                    //CompactSQL comsql = new CompactSQL();
                                    //comsql.InsertRecord("ChangeSize", array);
                                }
                                else
                                {
                                    if (flagLocation == false)
                                    {
                                        BinQH.BinQH_Service binservice = new QHMobile.BinQH.BinQH_Service();
                                        binservice.Url         = WebServiceInstants.GetURL(ServiceType.BinQH);
                                        binservice.Credentials = nc;

                                        List <BinQH.BinQH_Filter> filterArr = new List <QHMobile.BinQH.BinQH_Filter>();

                                        BinQH.BinQH_Filter bincodefilter = new QHMobile.BinQH.BinQH_Filter();
                                        bincodefilter.Field    = QHMobile.BinQH.BinQH_Fields.Code;
                                        bincodefilter.Criteria = txtBinCode.Text.Trim();

                                        filterArr.Add(bincodefilter);


                                        BinQH.BinQH[] binqhget = binservice.ReadMultiple(filterArr.ToArray(), null, 3);

                                        if (binqhget.Length == 0)
                                        {
                                            MessageBox.Show("Location and Bin is not found.");
                                            txtItemNo.SelectAll();
                                            txtItemNo.Focus();
                                        }
                                        else
                                        {
                                            DailyLossFormTS insert = new DailyLossFormTS();
                                            Object[]        array  = new Object[9];

                                            insert.itemno         = txtItemNo.Text.Trim();
                                            array[0]              = txtItemNo.Text.Trim();
                                            insert.entrytype      = cboEntryType.Text.Trim();
                                            array[1]              = txtDescription.Text.Trim();
                                            insert.description    = txtDescription.Text.Trim();
                                            array[2]              = cboEntryType.Text.Trim();
                                            insert.location       = txtLocation.Text.Trim();
                                            array[3]              = txtLocation.Text.Trim();
                                            insert.bincode        = txtBinCode.Text.Trim();
                                            array[4]              = txtBinCode.Text.Trim();
                                            insert.quantity       = txtQuantity.Text.Trim();
                                            array[5]              = txtQuantity.Text.Trim();
                                            insert.staffdimension = staffdim;
                                            array[6]              = staffdim;
                                            insert.postdate       = txtPostingDate.Text.Trim();
                                            array[7]              = Convert.ToDateTime(txtPostingDate.Text.Trim());
                                            if (chkEmpty.Checked)
                                            {
                                                array[8] = true;
                                            }
                                            else
                                            {
                                                array[8] = false;
                                            }
                                            dl_array.Add(insert);
                                            dt.Rows.Add(array);
                                            lblCount.Text = dt.Rows.Count.ToString();

                                            //tempthu
                                            CompactSQL comsql = new CompactSQL();
                                            comsql.InsertRecord("ChangeSize", array);

                                            getdata = comsql.SelectRecord("ChangeSize"); //test3
                                            GetSQLData(getdata);                         //test3
                                            CallBindGrid();
                                        }
                                    }
                                }
                            }
                        }
                        else
                        {
                            MessageBox.Show("All fields are required to enter.");
                        }

                        count = count + 1;
                        txtItemNo.SelectAll();
                        txtItemNo.Focus();
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(txtItemNo.Text.Trim()) && !string.IsNullOrEmpty(txtBinCode.Text.Trim()) && !string.IsNullOrEmpty(txtLocation.Text.Trim()) && !string.IsNullOrEmpty(txtQuantity.Text.Trim()) && !txtQuantity.Text.Trim().Equals("0"))
                        {
                            bool isNum = IsItNumber(txtQuantity.Text.Trim());

                            if (isNum)
                            {
                                // bool flagLocation = LocationValidating();

                                bool flagItem = ItemValidating();

                                if (flagItem == true)
                                {
                                    count = 0;

                                    DailyLossFormTS insert = new DailyLossFormTS();
                                    Object[]        array  = new Object[9];

                                    insert.itemno         = txtItemNo.Text.Trim();
                                    array[0]              = txtItemNo.Text.Trim();
                                    insert.entrytype      = cboEntryType.Text.Trim();
                                    array[1]              = txtDescription.Text.Trim();
                                    insert.description    = txtDescription.Text.Trim();
                                    array[2]              = cboEntryType.Text.Trim();
                                    insert.location       = txtLocation.Text.Trim();
                                    array[3]              = txtLocation.Text.Trim();
                                    insert.bincode        = txtBinCode.Text.Trim();
                                    array[4]              = txtBinCode.Text.Trim();
                                    insert.quantity       = txtQuantity.Text.Trim();
                                    array[5]              = txtQuantity.Text.Trim();
                                    insert.staffdimension = staffdim;
                                    array[6]              = staffdim;
                                    insert.postdate       = txtPostingDate.Text.Trim();
                                    array[7]              = Convert.ToDateTime(txtPostingDate.Text.Trim());
                                    if (chkEmpty.Checked)
                                    {
                                        array[8] = true;
                                    }
                                    else
                                    {
                                        array[8] = false;
                                    }

                                    dl_array.Add(insert);
                                    dt.Rows.Add(array);
                                    lblCount.Text = dt.Rows.Count.ToString();
                                    CallBindGrid();

                                    //CompactSQL comsql = new CompactSQL();
                                    //comsql.InsertRecord("ChangeSize", array);

                                    //tempthu
                                    CompactSQL comsql = new CompactSQL();
                                    comsql.InsertRecord("ChangeSize", array);

                                    getdata = comsql.SelectRecord("ChangeSize"); //test3
                                    GetSQLData(getdata);                         //test3
                                    CallBindGrid();
                                    //tempthu
                                }
                                else
                                {
                                    if (flagItem == false)
                                    {
                                        MessageBox.Show("Item is not found.");
                                        txtItemNo.Focus();
                                    }
                                }
                            }
                        }
                        else
                        {
                            MessageBox.Show("All fields are required to enter.");
                        }
                    }

                    if (count == 1)
                    {
                        // txtBinCode.Enabled = false;
                        //txtItemNo.Enabled = true;
                        txtLocation.Enabled = false;
                        cboEntryType.Text   = cboEntryType.Items[0].ToString();
                    }
                    else
                    {
                        txtBinCode.Enabled  = true;
                        txtBinCode.Text     = "";
                        txtItemNo.Enabled   = true;
                        txtItemNo.Text      = "";
                        txtLocation.Enabled = true;
                        txtLocation.Text    = "";
                        txtQuantity.Text    = "";
                        txtBinCode.Focus();
                        cboEntryType.Text = cboEntryType.Items[1].ToString();
                    }
                    Cursor.Current = Cursors.Default;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Cursor.Current = Cursors.Default;
            }
        }
Ejemplo n.º 14
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                if (!string.IsNullOrEmpty(txtBinCode.Text.Trim()) && !string.IsNullOrEmpty(txtQuantity.Text.Trim()) && !txtQuantity.Text.Trim().Equals("0") && !string.IsNullOrEmpty(txtItemNo.Text.Trim()) && !string.IsNullOrEmpty(txtQuantity.Text.Trim()) && !string.IsNullOrEmpty(txtLocation.Text.Trim()) && !string.IsNullOrEmpty(txtPostingDate.Text.Trim()))
                //if (!txtBinCode.Text.Equals("") && !txtQuantity.Text.Equals("") && !txtItemNo.Text.Equals("") && !txtQuantity.Text.Equals("") && !txtLocation.Text.Equals("") && !txtPostingDate.Text.Equals(""))
                {
                    bool isNum = IsItNumber(txtQuantity.Text.Trim());

                    if (isNum)
                    {
                        int flagLocation = QtyValidating();

                        //bool flagItem = ItemValidating();

                        if (flagLocation == 1 || flagLocation == 2)
                        {
                            DailyLossQH insert_dl = new DailyLossQH();
                            Object[]    array     = new Object[7];

                            insert_dl.itemno = txtItemNo.Text.Trim();
                            array[0]         = Convert.ToDateTime(txtPostingDate.Text);

                            insert_dl.location       = txtLocation.Text.Trim();
                            array[1]                 = txtItemNo.Text.Trim();
                            insert_dl.quantity       = txtQuantity.Text.Trim();
                            array[2]                 = txtLocation.Text.Trim();
                            insert_dl.bincode        = txtBinCode.Text.Trim();
                            array[3]                 = txtQuantity.Text.Trim();
                            insert_dl.postingDate    = txtPostingDate.Text;
                            array[4]                 = txtBinCode.Text.Trim();
                            insert_dl.staffdimension = staffdim;
                            array[5]                 = staffdim;
                            if (chkEmpty.Checked)
                            {
                                insert_dl.emptyTank = true;
                                array[6]            = true;
                            }
                            else
                            {
                                insert_dl.emptyTank = false;
                                array[6]            = false;
                            }



                            array_daily.Add(insert_dl);
                            dt.Rows.Add(array);
                            lblCount.Text = dt.Rows.Count.ToString();
                            //CallGridBind();

                            CompactSQL comsql = new CompactSQL();
                            comsql.InsertRecord("DailyLoss", array);

                            getdata = comsql.SelectRecord("DailyLoss");
                            GetSQLData(getdata);


                            txtQuantity.Text    = "";
                            txtItemNo.Text      = "";
                            txtLocation.Text    = "";
                            txtPostingDate.Text = "";
                            txtBinCode.Enabled  = true;
                            txtBinCode.Text     = "";
                            txtBinCode.Focus();
                            chkEmpty.Checked = false;
                        }
                        else if (flagLocation == 3)
                        {
                            MessageBox.Show("Item Not found!");
                        }
                        else
                        {
                            //MessageBox.Show("Item Not found!");
                            txtQuantity.Focus();
                            //if (flagLocation == 2)
                            //{
                            //    MessageBox.Show("Item Not found!");
                            //    txtQuantity.Focus();
                            //}
                            //else
                            //{
                            //    MessageBox.Show("Item is not found.");
                            //    txtItemNo.Focus();
                            //}
                        }
                    }
                    else
                    {
                        MessageBox.Show("Quantity value must be integer.");
                        txtQuantity.Text = "";
                        txtQuantity.Focus();
                    }

                    txtQuantity.Enabled    = false;
                    txtPostingDate.Enabled = false;
                    //txtBinCode.Enabled = true;
                }
                else
                {
                    MessageBox.Show("All fields are required to enter and quantity must be larger than 0.");
                    txtBinCode.SelectAll();
                    txtBinCode.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }

            Cursor.Current = Cursors.Default;
        }
Ejemplo n.º 15
0
        public TransferOrder(string Rstaffname, string Rstaffdimension, string Rstafflevel)
        {
            InitializeComponent();
            journalarray.Clear();
            txtFromBin.Focus();


            this.staffname      = Rstaffname;
            this.staffdimension = Rstaffdimension;
            this.stafflevel     = Rstafflevel;


            tableJournal.Columns.Add("Posting Date");
            tableJournal.Columns.Add("Item No");
            tableJournal.Columns.Add("Location");
            tableJournal.Columns.Add("From Bin");
            tableJournal.Columns.Add("To Bin");
            tableJournal.Columns.Add("Quantity");
            tableJournal.Columns.Add("Staff Code");
            tableJournal.Columns.Add("LineNo");//test3
            tableJournal.Columns.Add("Empty Tank");


            PostJournal.Columns.Add("Item No");
            PostJournal.Columns.Add("From Location");
            PostJournal.Columns.Add("From Bin");
            PostJournal.Columns.Add("To Location");
            PostJournal.Columns.Add("To Bin");
            PostJournal.Columns.Add("Quantity");
            BindPostLines();

            CompactSQL comsql = new CompactSQL();

            getdata = comsql.SelectRecord("ItemReclass");
            GetSQLData(getdata);


            tbScanLine.Show();
            mnuPostToNav.Enabled = true;
            menuItem1.Enabled    = true;
            menuItem2.Enabled    = true;
            menuItem3.Enabled    = true;

            lblStaffDimension.Text = staffdimension;

            //if (Rstafflevel.Equals("Super"))
            //{
            //    tbScanLine.Show();
            //    mnuPostToNav.Enabled = true;
            //    menuItem1.Enabled = true;
            //    menuItem2.Enabled = true;
            //    menuItem3.Enabled = true;


            //}
            //else
            //{
            //    tbScanLine.Show();
            //    tbLinePost.Show();
            //    mnuPostToNav.Enabled = true;
            //    menuItem1.Enabled = true;
            //    menuItem2.Enabled = true;
            //    menuItem3.Enabled = true;

            //    //tbLinePost.Hide();
            //    //mnuPostToNav.Enabled = false;
            //    //menuItem1.Enabled = true;
            //    //menuItem2.Enabled = true;
            //    //menuItem3.Enabled = true;
            //}
        }
Ejemplo n.º 16
0
        private void btnAdd_Click_1(object sender, EventArgs e)
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                Object[]            array    = new Object[4];
                PurchaseOrderModule pomodule = new PurchaseOrderModule();

                array[0] = txtItemNo.Text.Trim();
                //SQL to save
                Object[] arraySQL = new Object[7];
                pomodule.itemno = txtItemNo.Text.Trim();
                arraySQL[0]     = txtVendorNo.Text.Trim();
                arraySQL[1]     = txtVendorName.Text.Trim();
                arraySQL[2]     = txtRegDate.Text.Trim();
                arraySQL[3]     = txtLocation.Text.Trim();
                arraySQL[4]     = txtItemNo.Text.Trim();
                arraySQL[6]     = Convert.ToInt32(txtQty.Text.Trim());


                if (!String.IsNullOrEmpty(txtItemNo.Text.Trim()))
                {
                    ItemQH.ItemQH_Service itemsev = new QHMobile.ItemQH.ItemQH_Service();
                    itemsev.Url         = WebServiceInstants.GetURL(ServiceType.ItemQH);
                    itemsev.Credentials = nc;

                    ItemQH.ItemQH itemdescription = itemsev.Read(txtItemNo.Text.Trim());
                    string        strItemDescription;
                    strItemDescription       = itemdescription.Description;
                    pomodule.itemDescription = strItemDescription;
                    array[1]    = strItemDescription;
                    arraySQL[5] = strItemDescription;
                }
                else
                {
                    arraySQL[5] = "";
                    pomodule.itemDescription = "";
                    array[1] = "";
                }


                array[2]          = txtLocation.Text.Trim();
                pomodule.location = txtLocation.Text.Trim();
                array[3]          = txtQty.Text.Trim();
                pomodule.quantity = txtQty.Text.Trim();


                PoArray.Add(pomodule);
                dt.Rows.Add(array);

                CompactSQL comsql = new CompactSQL();
                comsql.InsertRecord("PurchaseOrder", arraySQL);

                /*
                 *  GrdPO.DataSource = dt;
                 *
                 *
                 *  txtItemNo.Text = "";
                 *  txtItemNo.Focus();
                 *  txtLocation.Enabled = false;
                 *  txtRegDate.Enabled = false;
                 *  txtQty.Enabled = false;
                 */

                //dffd

                getdata = comsql.SelectRecord("PurchaseOrder");
                GetSQLData(getdata, false);

                Cursor.Current = Cursors.Default;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error:" + ex);
                Cursor.Current = Cursors.Default;
            }
        }
Ejemplo n.º 17
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                if (!string.IsNullOrEmpty(txtBin.Text) && !string.IsNullOrEmpty(txtItemNo.Text) && !string.IsNullOrEmpty(txtQty.Text))
                {
                    txtBin.Enabled    = true;
                    txtQty.Enabled    = false;
                    txtItemNo.Enabled = false;
                    textBox1.Enabled  = false;

                    string   itemNo;
                    string   binNo;
                    int      quantity;
                    DateTime postdate;
                    string   staffname;
                    DateTime entrydate;
                    string   categ;

                    itemNo    = txtItemNo.Text;
                    binNo     = txtBin.Text;
                    postdate  = Convert.ToDateTime(textBox1.Text);
                    staffname = staffdim;
                    entrydate = Convert.ToDateTime(textBox1.Text);
                    categ     = txtCategory.Text.Trim();

                    bool isNum = IsItNumber(txtQty.Text.Trim());

                    if (txtQty.Text.Equals("") || txtBin.Text.Equals(""))
                    {
                        MessageBox.Show("All field are required to enter");
                    }
                    else
                    {
                        if (isNum)
                        {
                            quantity = Convert.ToInt32(txtQty.Text);
                            AddtoRow(itemNo, binNo, quantity, postdate, staffname, entrydate, categ);
                            //dgGRNLine.DataSource = dt;
                            CompactSQL comsql = new CompactSQL();
                            getdata = comsql.SelectRecord("StockTakeEntry");
                            GetSQLData(getdata);



                            txtBin.Focus();
                            txtItemNo.Text       = "";
                            textBox1.Text        = "";
                            txtQty.Text          = "";
                            txtBin.Text          = "";
                            txtCategory.Text     = "";
                            txtDescription.Text  = "";
                            txtDescription2.Text = "";
                        }
                        else
                        {
                            MessageBox.Show("Invalid Qty Number!");
                            txtQty.Text = "";
                            txtQty.Focus();
                            dgGRNLine.DataSource = dt;
                        }
                    }
                }
            }catch (Exception ex)
            {
                MessageBox.Show("Error" + ex);
            }
        }