예제 #1
0
        private void RecordTSB_Click(object sender, EventArgs e)
        {
            DataSet data = new grndetailCRUD().SearchDataGrn(txtStyleID.Text, txtStyleDesc.Text, GlobalVariables.GCode);

            DtGrid.DataSource = data;
            DtGrid.DataMember = "tblgrndetail";
        }
예제 #2
0
        private void cmdStyle_Click(object sender, EventArgs e)
        {
            GStrCode = "";
            frmginGarmentSearchStyle f = new frmginGarmentSearchStyle();

            f.AddItemCallback     = new frmginGarmentSearchStyle.AddStyleDelegate(this.SetStyleCallBack);
            GlobalVariables.GCode = "RAW";
            f.ShowDialog();

            if (GStrCode != "")
            {
                DataSet dsDetail = new grndetailCRUD().getDataStyle(GStrCode);
                cbJENIS.Text = "RAW";
                //dtGrid.Rows.Clear();
                Int32 index = dtGrid.Rows.Count - 1;
                for (int i = 0; i < dsDetail.Tables[0].Rows.Count; i++)
                {
                    dtGrid.Rows.Add();
                    dtGrid.Rows[index].HeaderCell.Value            = "#";
                    dtGrid.Rows[index].Cells["hID"].Value          = index;//dsDetail.Tables[0].Rows[i]["ID"].ToString();
                    dtGrid.Rows[index].Cells["hItemsID"].Value     = Convert.ToString(dsDetail.Tables[0].Rows[0]["ITEMSID"]);
                    dtGrid.Rows[index].Cells["hDescription"].Value = Convert.ToString(dsDetail.Tables[0].Rows[0]["ITEMSID"]);
                    dtGrid.Rows[index].Cells["hJenis"].Value       = dsDetail.Tables[0].Rows[i]["JENIS"].ToString();
                    dtGrid.Rows[index].Cells["hColorID"].Value     = Convert.ToString(dsDetail.Tables[0].Rows[i]["COLORID"]);
                    dtGrid.Rows[index].Cells["hSizeID"].Value      = Convert.ToString(dsDetail.Tables[0].Rows[i]["SIZEID"]);
                    dtGrid.Rows[index].Cells["hGrade"].Value       = DBNull.Value.Equals(dsDetail.Tables[0].Rows[i]["GRADE"]) ? null : dsDetail.Tables[0].Rows[i]["GRADE"].ToString();
                    dtGrid.Rows[index].Cells["hPONO"].Value        = Convert.ToString(dsDetail.Tables[0].Rows[0]["PONO"]);
                    dtGrid.Rows[index].Cells["hStyleID"].Value     = Convert.ToString(dsDetail.Tables[0].Rows[0]["STYLEID"]);
                    dtGrid.Rows[index].Cells["hStyleIDto"].Value   = Convert.ToString(dsDetail.Tables[0].Rows[0]["STYLEID"]);
                    dtGrid.Rows[index].Cells["hQuantity"].Value    = Convert.ToString(dsDetail.Tables[0].Rows[i]["QTYOH"]);
                    dtGrid.Rows[index].Cells["hUOM"].Value         = Convert.ToString(dsDetail.Tables[0].Rows[i]["UOM"]);
                    dtGrid.Rows[index].Cells["hGRNNO"].Value       = Convert.ToString(dsDetail.Tables[0].Rows[i]["GRNNO"]);
                    index++;
                }
            }
            SimpanTSB.Enabled = true;
            UbahTSB.Enabled   = true;
            dtGrid.Enabled    = true;
        }
예제 #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");
            }
        }
예제 #4
0
        private void RecordTSB_Click(object sender, EventArgs e)
        {
            GStrCode = "";
            frmgrnSearch f = new frmgrnSearch();

            GlobalVariables.GCode = "PRODUCT";
            f.AddItemCallback     = new frmgrnSearch.AddPurchaseDelegate(this.SetPurchaseCallBack);
            f.ShowDialog();

            //txtCostingNo.Text
            if (GStrCode != "")
            {
                //load header
                //GRNNO,DATE,OFFICER,GDIV,RECEIVEFROM,REMARKS,STOREID,PONO,CUSTVENDCODE,REFFNO,APPROVE,APPROVEDATE,APPROVEBY,
                //CLOSE,STYLEID,COLORID,DOCREGNO,JENIS,
                DataSet dsHeader = new grnCRUD().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]["REFFNO"].ToString();
                txtJONO.Text       = dsHeader.Tables[0].Rows[0]["PONO"].ToString();
                cbJENIS.Text       = dsHeader.Tables[0].Rows[0]["JENIS"].ToString();
                cbStore.Text       = dsHeader.Tables[0].Rows[0]["STOREID"].ToString();



                //load detail
                DataSet dsDetail = new grndetailCRUD().getData(GStrCode);
                dtGrid.Rows.Clear();
                for (int i = 0; i < dsDetail.Tables[0].Rows.Count; i++)
                {
                    GlobalVariables.GID = GlobalVariables.GID + 1;
                    // ID,ITEMSID,DESCRIPTION,JENIS,COLORID,SIZEID,GRADE,COSTINGNO,STYLEID,PONO,QUANTITY,UOM,
                    //PRICE,CURRENCYID,KURS,REMARKS,QTYPURCHASE,PRICEPURCHASE,UOMPURCHASE,
                    dtGrid.Rows.Add();
                    dtGrid.Rows[i].HeaderCell.Value = "V";
                    //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["hGRNNo"].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["hColorID"].Value     = dsDetail.Tables[0].Rows[i]["COLORID"].ToString();
                    dtGrid.Rows[i].Cells["hSizeID"].Value      = dsDetail.Tables[0].Rows[i]["SIZEID"].ToString();
                    //if (row[col] == DBNull.Value)
                    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["hCostingNo"].Value = dsDetail.Tables[0].Rows[i]["COSTINGNO"].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["hPrice"].Value = dsDetail.Tables[0].Rows[i]["PRICE"].ToString();
                    //dtGrid.Rows[i].Cells["hCurrencyID"].Value = dsDetail.Tables[0].Rows[i]["CURRENCYID"].ToString();
                    //dtGrid.Rows[i].Cells["hKurs"].Value = dsDetail.Tables[0].Rows[i]["KURS"].ToString();
                    dtGrid.Rows[i].Cells["hConvert"].Value = dsDetail.Tables[0].Rows[i]["CONVER"].ToString();
                    //dtGrid.Rows[i].Cells["hRemarks"].Value = dsDetail.Tables[0].Rows[i]["REMARKS"].ToString();
                    dtGrid.Rows[i].Cells["hQtyPurchase"].Value = dsDetail.Tables[0].Rows[i]["QTYPURCHASE"].ToString();
                    //dtGrid.Rows[i].Cells["hPricePurchase"].Value = dsDetail.Tables[0].Rows[i]["PRICEPURCHASE"].ToString();
                    dtGrid.Rows[i].Cells["hUOMPurchase"].Value = dsDetail.Tables[0].Rows[i]["UOMPURCHASE"].ToString();
                }
                SimpanTSB.Enabled = false;
                UbahTSB.Enabled   = true;
                dtGrid.Enabled    = true;
            }
        }