Ejemplo n.º 1
0
        private void RecordTSB_Click(object sender, EventArgs e)
        {
            frmginSearch f = new frmginSearch();

            GlobalVariables.GCode = "PROCESS";
            f.AddItemCallback     = new frmginSearch.AddPurchaseDelegate(this.SetPurchaseCallBack);
            f.ShowDialog();
            //txtCostingNo.Text
            if (GStrCode != "")
            {
                DataSet dsHeader = new ginCRUD().getData(GStrCode);
                txtGRNNO.Text       = GStrCode;
                dateCreated.Value   = (DateTime)dsHeader.Tables[0].Rows[0]["DATE"];
                cbDIV.SelectedValue = dsHeader.Tables[0].Rows[0]["GDIV"];
                //RECEIVEFROM  di hilangkan
                //
                txtRemarks.Text    = dsHeader.Tables[0].Rows[0]["REMARKS"].ToString();
                txtCustomerID.Text = dsHeader.Tables[0].Rows[0]["CUSTVENDCODE"].ToString();
                txtRefer.Text      = dsHeader.Tables[0].Rows[0]["DELIVERYTO"].ToString();
                // txtPONO.Text = dsHeader.Tables[0].Rows[0]["PONO"].ToString();
                cbJENIS.Text = dsHeader.Tables[0].Rows[0]["TYPE"].ToString();
                cbStore.Text = dsHeader.Tables[0].Rows[0]["STOREID"].ToString();



                //load detail
                DataSet dsDetail = new gindetailCRUD().getData(GStrCode);
                dtGrid.Rows.Clear();
                for (int i = 0; i < dsDetail.Tables[0].Rows.Count; i++)
                {
                    GlobalVariables.GID = GlobalVariables.GID + 1;
                    dtGrid.Rows.Add();
                    dtGrid.Rows[i].HeaderCell.Value = "V";
                    //key
                    dtGrid.Rows[i].Cells["hGINNo1"].Value = dsDetail.Tables[0].Rows[i]["GINNO"].ToString();
                    dtGrid.Rows[i].Cells["hID1"].Value    = dsDetail.Tables[0].Rows[i]["ID"].ToString();
                    //end key
                    dtGrid.Rows[i].Cells["hGINNo"].Value       = dsDetail.Tables[0].Rows[i]["GINNO"].ToString();
                    dtGrid.Rows[i].Cells["hID"].Value          = dsDetail.Tables[0].Rows[i]["ID"].ToString();
                    dtGrid.Rows[i].Cells["hItemsID"].Value     = dsDetail.Tables[0].Rows[i]["ITEMSID"].ToString();
                    dtGrid.Rows[i].Cells["hDescription"].Value = dsDetail.Tables[0].Rows[i]["DESCRIPTION"].ToString();
                    dtGrid.Rows[i].Cells["hJenis"].Value       = dsDetail.Tables[0].Rows[i]["JENIS"].ToString();
                    dtGrid.Rows[i].Cells["hColorID"].Value     = dsDetail.Tables[0].Rows[i]["COLORID"].ToString();
                    dtGrid.Rows[i].Cells["hSizeID"].Value      = dsDetail.Tables[0].Rows[i]["SIZEID"].ToString();

                    dtGrid.Rows[i].Cells["hGrade"].Value = DBNull.Value.Equals(dsDetail.Tables[0].Rows[i]["GRADE"]) ? null : dsDetail.Tables[0].Rows[i]["GRADE"].ToString();

                    dtGrid.Rows[i].Cells["hStyleID"].Value  = dsDetail.Tables[0].Rows[i]["STYLEID"].ToString();
                    dtGrid.Rows[i].Cells["hPONO"].Value     = dsDetail.Tables[0].Rows[i]["PONO"].ToString();
                    dtGrid.Rows[i].Cells["hQuantity"].Value = dsDetail.Tables[0].Rows[i]["QUANTITY"].ToString();
                    dtGrid.Rows[i].Cells["hUOM"].Value      = dsDetail.Tables[0].Rows[i]["UOM"].ToString();
                    // dtGrid.Rows[i].Cells["hConvert"].Value = dsDetail.Tables[0].Rows[i]["CONVER"].ToString();
                    //  dtGrid.Rows[i].Cells["hQtyPurchase"].Value = dsDetail.Tables[0].Rows[i]["QTYPURCHASE"].ToString();
                    // dtGrid.Rows[i].Cells["hUOMPurchase"].Value = dsDetail.Tables[0].Rows[i]["UOMPURCHASE"].ToString();
                }
                SimpanTSB.Enabled = false;
                UbahTSB.Enabled   = true;
                dtGrid.Enabled    = true;
            }
        }
Ejemplo n.º 2
0
        private void cmdStyle_Click(object sender, EventArgs e)
        {
            frmginSearch f = new frmginSearch();

            GlobalVariables.GCode = "PROCESS";
            f.AddItemCallback     = new frmginSearch.AddPurchaseDelegate(this.SetPurchaseCallBack);
            f.ShowDialog();
            //txtCostingNo.Text

            if (GStrCode != "")
            {
                //load detail
                DataSet dsDetail = new gindetailCRUD().getData(GStrCode);
                dtGrid.Rows.Clear();
                for (int i = 0; i < dsDetail.Tables[0].Rows.Count; i++)
                {
                    GlobalVariables.GID = GlobalVariables.GID + 1;
                    dtGrid.Rows.Add();
                    dtGrid.Rows[i].HeaderCell.Value = "V";
                    //key
                    dtGrid.Rows[i].Cells["hGINNo1"].Value = dsDetail.Tables[0].Rows[i]["GINNO"].ToString();
                    dtGrid.Rows[i].Cells["hID1"].Value    = dsDetail.Tables[0].Rows[i]["ID"].ToString();
                    //end key
                    dtGrid.Rows[i].Cells["hGINNo"].Value       = dsDetail.Tables[0].Rows[i]["GINNO"].ToString();
                    dtGrid.Rows[i].Cells["hID"].Value          = dsDetail.Tables[0].Rows[i]["ID"].ToString();
                    dtGrid.Rows[i].Cells["hItemsID"].Value     = dsDetail.Tables[0].Rows[i]["ITEMSID"].ToString();
                    dtGrid.Rows[i].Cells["hDescription"].Value = dsDetail.Tables[0].Rows[i]["DESCRIPTION"].ToString();
                    dtGrid.Rows[i].Cells["hJenis"].Value       = dsDetail.Tables[0].Rows[i]["JENIS"].ToString();
                    dtGrid.Rows[i].Cells["hColorID"].Value     = dsDetail.Tables[0].Rows[i]["COLORID"].ToString();
                    dtGrid.Rows[i].Cells["hSizeID"].Value      = dsDetail.Tables[0].Rows[i]["SIZEID"].ToString();

                    dtGrid.Rows[i].Cells["hGrade"].Value = DBNull.Value.Equals(dsDetail.Tables[0].Rows[i]["GRADE"]) ? null : dsDetail.Tables[0].Rows[i]["GRADE"].ToString();

                    dtGrid.Rows[i].Cells["hStyleID"].Value  = dsDetail.Tables[0].Rows[i]["STYLEID"].ToString();
                    dtGrid.Rows[i].Cells["hPONO"].Value     = dsDetail.Tables[0].Rows[i]["PONO"].ToString();
                    dtGrid.Rows[i].Cells["hQuantity"].Value = dsDetail.Tables[0].Rows[i]["QUANTITY"].ToString();
                    dtGrid.Rows[i].Cells["hUOM"].Value      = dsDetail.Tables[0].Rows[i]["UOM"].ToString();
                }
            }
            SimpanTSB.Enabled = true;
            UbahTSB.Enabled   = true;
            dtGrid.Enabled    = true;
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            GStrCode = "";
            if (cbTypeID.Text == "PENGELUARAN")
            {
                frmginSearch f = new frmginSearch();
                f.AddItemCallback = new frmginSearch.AddPurchaseDelegate(this.SetPurchaseCallBack);
                f.ShowDialog();
                if (GStrCode != "")
                {
                    DataSet dsDetail = new gindetailCRUD().getData(GStrCode);
                    dtGrid.Rows.Clear();
                    for (int i = 0; i < dsDetail.Tables[0].Rows.Count; i++)
                    {
                        dtGrid.Rows.Add();
                        dtGrid.Rows[i].HeaderCell.Value            = "#";
                        dtGrid.Rows[i].Cells["hTransNo"].Value     = Convert.ToString(dsDetail.Tables[0].Rows[i]["GINNO"]);
                        dtGrid.Rows[i].Cells["hID"].Value          = Convert.ToString(dsDetail.Tables[0].Rows[i]["ID"]);
                        dtGrid.Rows[i].Cells["hItemsID"].Value     = Convert.ToString(dsDetail.Tables[0].Rows[i]["ITEMSID"]);
                        dtGrid.Rows[i].Cells["hDescription"].Value = Convert.ToString(dsDetail.Tables[0].Rows[i]["DESCRIPTION"]);
                        // dtGrid.Rows[i].Cells["hJenis"].Value = Convert.ToString(dsDetail.Tables[0].Rows[i]["JENIS"]);
                        // dtGrid.Rows[i].Cells["hColorID"].Value = Convert.ToString(dsDetail.Tables[0].Rows[i]["COLORID"]);
                        // dtGrid.Rows[i].Cells["hSizeID"].Value = Convert.ToString(dsDetail.Tables[0].Rows[i]["SIZEID"]);
                        // dtGrid.Rows[i].Cells["hGrade"].Value = DBNull.Value.Equals(dsDetail.Tables[0].Rows[i]["GRADE"]) ? null : dsDetail.Tables[0].Rows[i]["GRADE"].ToString();
                        dtGrid.Rows[i].Cells["hStyleID"].Value = Convert.ToString(dsDetail.Tables[0].Rows[i]["STYLEID"]);
                        // dtGrid.Rows[i].Cells["hPONO"].Value = Convert.ToString(dsDetail.Tables[0].Rows[i]["PONO"]);
                        dtGrid.Rows[i].Cells["hQuantity"].Value = Convert.ToString(dsDetail.Tables[0].Rows[i]["QUANTITY"]);
                        dtGrid.Rows[i].Cells["hUOM"].Value      = Convert.ToString(dsDetail.Tables[0].Rows[i]["UOM"]);
                        //dtGrid.Rows[i].Cells["hPrice"].Value = Convert.ToString(dsDetail.Tables[0].Rows[i]["PRICE"]);
                        //dtGrid.Rows[i].Cells["hKurs"].Value = Convert.ToString(dsDetail.Tables[0].Rows[i]["KURS"]);
                    }
                }
            }
            else if (cbTypeID.Text == "PEMASUKAN")
            {
                frmgrnSearch f = new frmgrnSearch();
                f.AddItemCallback = new frmgrnSearch.AddPurchaseDelegate(this.SetPurchaseCallBack);
                f.ShowDialog();

                if (GStrCode != "")
                {
                    DataSet dsDetail = new grndetailCRUD().getData(GStrCode);
                    dtGrid.Rows.Clear();
                    for (int i = 0; i < dsDetail.Tables[0].Rows.Count; i++)
                    {
                        dtGrid.Rows.Add();
                        dtGrid.Rows[i].HeaderCell.Value = "#";
                        //key
                        //  dtGrid.Rows[i].Cells["hGRNNo1"].Value = dsDetail.Tables[0].Rows[i]["GRNNO"].ToString();
                        //  dtGrid.Rows[i].Cells["hID1"].Value = dsDetail.Tables[0].Rows[i]["ID"].ToString();
                        //end key
                        dtGrid.Rows[i].Cells["hTransNo"].Value     = dsDetail.Tables[0].Rows[i]["GRNNO"].ToString();
                        dtGrid.Rows[i].Cells["hID"].Value          = dsDetail.Tables[0].Rows[i]["ID"].ToString();
                        dtGrid.Rows[i].Cells["hItemsID"].Value     = dsDetail.Tables[0].Rows[i]["ITEMSID"].ToString();
                        dtGrid.Rows[i].Cells["hDescription"].Value = dsDetail.Tables[0].Rows[i]["DESCRIPTION"].ToString();
                        //dtGrid.Rows[i].Cells["hJenis"].Value = dsDetail.Tables[0].Rows[i]["JENIS"].ToString();

                        dtGrid.Rows[i].Cells["hStyleID"].Value = dsDetail.Tables[0].Rows[i]["STYLEID"].ToString();

                        dtGrid.Rows[i].Cells["hQuantity"].Value = dsDetail.Tables[0].Rows[i]["QUANTITY"].ToString();
                        dtGrid.Rows[i].Cells["hUOM"].Value      = dsDetail.Tables[0].Rows[i]["UOM"].ToString();
                    }
                }
            }
            else
            {
                MessageBox.Show("You must select type");
            }
        }