Пример #1
0
    private void SearchData()
    {
        this.txtRefNo.Text = "";
        SearchFlow flow = new SearchFlow();
        StockoutSearchData data = new StockoutSearchData();
        data.REQCODETO = this.txtCodeTo.Text.Trim();
        data.REQCODEFROM = this.txtCodeFrom.Text.Trim();
        //data.REQUISITIONTYPE = Convert.ToDouble(this.cmbRequisitionType.SelectedValue);
        data.REQUESTDATEFROM = this.ctlDateFrom.DateValue;
        data.REQUESTDATETO = this.ctlDateTo.DateValue;
        data.PRODUCT = Convert.ToDouble(this.cmbProduct.SelectedValue);

        string sType = Request["type"];
        if (sType == "12")
        {
            this.grvReserve.DataSource = flow.GetProductionList(data);
        }
        else
        {
            this.grvReserve.DataSource = flow.GetReqProductionList(data);
        }
        this.grvReserve.DataBind();
        // this.btnSelect.Visible = (this.grvReserve.Rows.Count > 0);
        if (this.grvReserve.SelectedValue == null)
            this.txtRefNo.Text = "";
        else
            this.txtRefNo.Text = this.grvReserve.SelectedValue.ToString();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Response.Expires = 0;
            Response.AddHeader("pragma", "no-cache");
            Response.AddHeader("cache-control", "private");
            Response.CacheControl = "no-cache";

            this.btnClose.OnClientClick = "window.close(); return false;";
            SearchFlow flow = new SearchFlow();
            PopupStockinReturnSearchData data = new PopupStockinReturnSearchData();

            if (Request.QueryString["DOCTYPE"] != null)
            {
                data.DOCTYPE = Convert.ToDouble(Request.QueryString["DOCTYPE"].ToString() == "" ? "0" : Request.QueryString["DOCTYPE"].ToString());
            }
            if (Request.QueryString["CUSTOMER"] != null)
            {
                data.CUSTOMER = Convert.ToDouble(Request.QueryString["CUSTOMER"].ToString() == "" ? "0" : Request.QueryString["CUSTOMER"].ToString());
            }
            if (Request.QueryString["REFLOID"] != null)
            {
                data.REFLOID = Convert.ToDouble(Request.QueryString["REFLOID"].ToString() == "" ? "0" : Request.QueryString["REFLOID"].ToString());
            }
            this.grvItem.DataSource = flow.GetStockinReturnSearchList(data);
            this.grvItem.DataBind();
        }
    }
Пример #3
0
 private void Search()
 {
     SearchFlow sFlow = new SearchFlow();
     this.grvProduct.DataSource = sFlow.GetProductReserveList(GetSearchData());
     this.grvProduct.DataBind();
     string scriptItem = "";
     if (this.grvProduct.Rows.Count > 0)
     {
         this.btnOKTop.Visible = true;
         this.btnOK.Visible = true;
         CheckBox chkAll = (CheckBox)this.grvProduct.HeaderRow.Cells[0].FindControl("chkAll");
         scriptItem += "document.getElementById('" + this.txtProduct.ClientID + "').value = '';\r\n";
         scriptItem += "var chk = document.getElementById('" + chkAll.ClientID + "').checked;\r\n";
         foreach (GridViewRow gRow in this.grvProduct.Rows)
         {
             scriptItem += "document.getElementById('" + ((CheckBox)gRow.Cells[0].FindControl("chkItem")).ClientID + "').checked = chk;\r\n";
             scriptItem += "if (chk) document.getElementById('" + this.txtProduct.ClientID + "').value += (document.getElementById('" + this.txtProduct.ClientID + "').value == '' ? '' : ', ') + '" + gRow.Cells[1].Text + "';\r\n";
         }
         chkAll.Attributes.Add("onclick", scriptItem);
     }
     else
     {
         this.btnOKTop.Visible = false;
         this.btnOK.Visible = false;
     }
 }
Пример #4
0
    private void SearchData()
    {
        SearchFlow flow = new SearchFlow();
        PopupStockoutBasketData data = new PopupStockoutBasketData();
        data.BARCODE = this.txtBarCode.Text.Trim();
        data.NAME = this.txtBasketName.Text.Trim();

        this.grvReserve.DataSource = flow.GetBasketList(data);
        this.grvReserve.DataBind();
    }
Пример #5
0
    private void SearchData()
    {
        SearchFlow flow = new SearchFlow();
        SearchInvoiceData data = new SearchInvoiceData();
        data.CUSTOMER = this.txtCustomerName.Text.Trim();
        data.INVCODEFROM = this.txtCodeFrom.Text.Trim();
        data.INVCODETO = this.txtCodeTo.Text.Trim();
        data.REQUISITIONTYPE = Convert.ToDouble(this.cmbRequisitionType.SelectedItem.Value);

        this.grvReserve.DataSource = flow.GetInvoiceList(data);
        this.grvReserve.DataBind();
    }
Пример #6
0
    private void SearchData()
    {
        SearchFlow flow = new SearchFlow();
        PopupStockoutSearchData data = new PopupStockoutSearchData();
        data.CODEFROM = this.txtCodeFrom.Text.Trim();
        data.CODETO = this.txtCodeTo.Text.Trim();
        data.DATEFROM = this.ctlDateFrom.DateValue;
        data.DATETO = this.ctlDateTo.DateValue;
        data.PRODUCTNAME = this.txtProductName.Text.Trim();

        this.grvReserve.DataSource = flow.GetProductReturnList(data);
        this.grvReserve.DataBind();
    }
Пример #7
0
    private void SearchData()
    {
        SearchFlow flow = new SearchFlow();
        PopupStockinReturnData data = new PopupStockinReturnData();
        data.CODEFROM = this.txtCodeFrom.Text.Trim();
        data.CODETO = this.txtCodeTo.Text.Trim();
        data.DATEFROM = this.ctlDateFrom.DateValue;
        data.DATETO = this.ctlDateTo.DateValue;
        data.CUSTOMERNAME = this.txtCustomerName.Text.Trim();
        data.REFLOID = Convert.ToDouble(this.cmbRefType.SelectedValue);

        this.grvStockinReturn.DataSource = flow.GetStockinReturnList(data);
        this.grvStockinReturn.DataBind();
    }
Пример #8
0
 private void SearchData()
 {
     this.txtCustomer.Text = "";
     SearchFlow flow = new SearchFlow();
     SearchCustomerData data = new SearchCustomerData();
     data.CODE = this.txtCode.Text.Trim();
     data.FULLNAME = this.txtFullName.Text.Trim();
     this.grvCustomer.DataSource = flow.GetSupplierList(data);
     this.grvCustomer.DataBind();
     if (this.grvCustomer.SelectedValue == null)
         this.txtCustomer.Text = "";
     else
         this.txtCustomer.Text = this.grvCustomer.SelectedValue.ToString();
 }
Пример #9
0
    private void SearchData()
    {
        SearchFlow flow = new SearchFlow();
        PopupStockinReturnData data = new PopupStockinReturnData();
        data.BARCODE = this.txtBarcode.Text.Trim();
        data.PRODUCTNAME = this.txtBarcode.Text.Trim();
        data.DATEFROM = this.ctlDateFrom.DateValue;
        data.DATETO = this.ctlDateTo.DateValue;
        data.LOTNO = this.txtLot.Text.Trim();


        this.grvItem.DataSource = flow.GetStockinReturnWHList(data);
        this.grvItem.DataBind();
    }
Пример #10
0
 private void SearchData()
 {
     this.txtCustomer.Text = "";
     SearchFlow flow = new SearchFlow();
     SearchCustomerData data = new SearchCustomerData();
     data.CODE = this.txtCode.Text.Trim();
     data.CUSTOMERTYPE = this.cmbCustomerType.SelectedItem.Value;
     data.FULLNAME = this.txtFullName.Text.Trim();
     data.MEMBERTYPE = Convert.ToDouble(this.cmbMemberType.SelectedItem.Value);
     this.grvCustomer.DataSource = flow.GetCustomerList(data);
     this.grvCustomer.DataBind();
     if (this.grvCustomer.SelectedValue == null)
         this.txtCustomer.Text = "";
     else
         this.txtCustomer.Text = this.grvCustomer.SelectedValue.ToString();
 }
Пример #11
0
    private void SearchData()
    {
        SearchFlow flow = new SearchFlow();
        PopupPOSearchData data = new PopupPOSearchData();
        data.CODEFROM = this.txtCodeFrom.Text.Trim();
        data.CODETO = this.txtCodeTo.Text.Trim();
        data.DATEFROM = this.ctlDateFrom.DateValue;
        data.DATETO = this.ctlDateTo.DateValue;
        if (Convert.ToDouble(this.cmbSupplier.SelectedValue) != 0)
        {
            data.SUPPLIER = this.cmbSupplier.SelectedValue;
        }


        this.grvReserve.DataSource = flow.GetPOList(data);
        this.grvReserve.DataBind();
    }
Пример #12
0
    private void SearchData()
    {
        this.txtRefNo.Text = "";
        SearchFlow flow = new SearchFlow();
        ProductReserveSearchData data = new ProductReserveSearchData();
        data.REQUISITIONTYPE = Convert.ToDouble(this.cmbRequisitionType.SelectedValue);
        if (this.cmbCustomer.SelectedValue != "")
            data.CUSTOMER = Convert.ToDouble(this.cmbCustomer.SelectedItem.Value == "" ? "0" : this.cmbCustomer.SelectedItem.Value);
        data.CODE = this.txtPopup.Text;


        this.grvReserve.DataSource = flow.GetReserveList(data);
        this.grvReserve.DataBind();
        if (this.grvReserve.SelectedValue == null)
            this.txtRefNo.Text = "";
        else
            this.txtRefNo.Text = this.grvReserve.SelectedValue.ToString();

        this.btnSelect.Visible = (this.grvReserve.Rows.Count > 0);
    }
Пример #13
0
    private void SearchData()
    {
        this.txtRefNo.Text = "";
        SearchFlow flow = new SearchFlow();
        StockInFGData data = new StockInFGData();
        data.CODETO = this.txtCodeTo.Text.Trim();
        data.CODEFROM = this.txtCodeFrom.Text.Trim();
        data.DATEFROM = this.ctlDateFrom.DateValue;
        data.DATETO = this.ctlDateTo.DateValue;
        data.PRODUCT = Convert.ToDouble(this.cmbProduct.SelectedValue);
        data.SENDER = Convert.ToDouble(this.cmbSupplier.SelectedValue);

        this.grvReserve.DataSource = flow.GetProductWHList(data);

        this.grvReserve.DataBind();
        // this.btnSelect.Visible = (this.grvReserve.Rows.Count > 0);
        if (this.grvReserve.SelectedValue == null)
            this.txtRefNo.Text = "";
        else
            this.txtRefNo.Text = this.grvReserve.SelectedValue.ToString();
    }
Пример #14
0
    private void SearchData()
    {
        this.txtRefNo.Text = "";
        SearchFlow flow = new SearchFlow();
        StockoutSearchData data = new StockoutSearchData();
        data.REQCODETO = this.txtCodeTo.Text.Trim();
        data.REQCODEFROM = this.txtCodeFrom.Text.Trim();
        //data.REQUISITIONTYPE = Convert.ToDouble(this.cmbRequisitionType.SelectedValue);
        data.CUSTOMERNAME = this.txtCustName.Text.Trim();
        data.CUSTOMERCODE = this.txtCustCode.Text.Trim();
        data.REQUESTDATEFROM = this.ctlDateFrom.DateValue;
        data.REQUESTDATETO = this.ctlDateTo.DateValue;

        this.grvReserve.DataSource = flow.GetRequisitionList(data);
        this.grvReserve.DataBind();
        //this.btnSelect.Visible = (this.grvReserve.Rows.Count > 0);
        if (this.grvReserve.SelectedValue == null)
            this.txtRefNo.Text = "";
        else
            this.txtRefNo.Text = this.grvReserve.SelectedValue.ToString();
    }
Пример #15
0
    private void SearchData()
    {
        SearchFlow flow = new SearchFlow();
        PopupProductPRSearchData data = new PopupProductPRSearchData();
        data.PRCODEFROM = this.txtFromPRCode.Text.Trim();
        data.PRCODETO = this.txtToPRCode.Text.Trim();
        data.DUEDATEFROM = this.ctlFromDueDate.DateValue;
        data.DUEDATETO = this.ctlToDueDate.DateValue;
        if (Convert.ToDouble(this.cmbPurchaseType.SelectedValue) != 0)
        {
            data.PURCHASETYPE = this.cmbPurchaseType.SelectedItem.Text;
        }
        if (Convert.ToDouble(this.cmbProduct.SelectedValue) != 0)
        {
            data.PRODUCT = this.cmbProduct.SelectedItem.Text;
        }
        if (Convert.ToDouble(this.cmbDivision.SelectedValue) != 0)
        {
            data.DIVISION = this.cmbDivision.SelectedItem.Text;
        }

        this.grvReserve.DataSource = flow.GetProductPRList(data);
        this.grvReserve.DataBind();
    }
Пример #16
0
 private void Search()
 {
     SearchFlow sFlow = new SearchFlow();
     this.grvProduct.DataSource = sFlow.GetProductPRList(GetSearchData());
     this.grvProduct.DataBind();
 }
Пример #17
0
        private void grvStockin_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            if (!this.grvStockin.Rows[e.RowIndex].IsNewRow)
            {
                if (e.ColumnIndex == indexBARCODE)
                {
                    string barcode = (this.grvStockin.Rows[e.RowIndex].Cells[indexBARCODE].Value == null ? "" : this.grvStockin.Rows[e.RowIndex].Cells[indexBARCODE].Value.ToString().Trim());

                    if (barcode == "")
                    {
                        this.grvStockin.Rows[e.RowIndex].Cells[indexPRODUCT].Value = DBNull.Value;
                        this.grvStockin.Rows[e.RowIndex].Cells[indexUNIT].Value = DBNull.Value;
                        this.grvStockin.Rows[e.RowIndex].Cells[indexBARCODE].Value = DBNull.Value;
                        this.grvStockin.Rows[e.RowIndex].Cells[indexNAME].Value = DBNull.Value;
                        this.grvStockin.Rows[e.RowIndex].Cells[indexQTY].Value = DBNull.Value;
                        this.grvStockin.Rows[e.RowIndex].Cells[indexPRICE].Value = DBNull.Value;
                        this.grvStockin.Rows[e.RowIndex].Cells[indexNETPRICE].Value = DBNull.Value;
                    }
                    else
                    {
                        if (barcode.Substring(0, 1) == "*")
                        {
                            this.grvStockin.Rows[e.RowIndex].Cells[indexPRODUCT].Value = DBNull.Value;
                            this.grvStockin.Rows[e.RowIndex].Cells[indexUNIT].Value = DBNull.Value;
                            this.grvStockin.Rows[e.RowIndex].Cells[indexBARCODE].Value = DBNull.Value;
                            this.grvStockin.Rows[e.RowIndex].Cells[indexNAME].Value = DBNull.Value;
                            this.grvStockin.Rows[e.RowIndex].Cells[indexQTY].Value = DBNull.Value;
                            this.grvStockin.Rows[e.RowIndex].Cells[indexPRICE].Value = DBNull.Value;
                            this.grvStockin.Rows[e.RowIndex].Cells[indexNETPRICE].Value = DBNull.Value;

                            if (barcode.Length > 1)
                            {
                                barcode = barcode.Substring(1);
                                this.grvStockin.Rows[e.RowIndex].Cells[indexQTY].Value = Convert.ToDouble(barcode);
                            }
                            this.grvStockin.Rows[e.RowIndex].Cells[indexBARCODE].Value = "";
                            endEditBarcode = false;
                        }
                        else
                        {
                            SearchFlow search = new SearchFlow();
                            ABB.Data.Search.SearchProductData data = new ABB.Data.Search.SearchProductData();
                            data.CODE = barcode.Trim();
                            DataTable dt = search.GetProductShopList(data);
                            if (dt.Rows.Count == 1)
                            {
                                this.grvStockin.Rows[e.RowIndex].Cells[indexPRODUCT].Value = dt.Rows[0]["LOID"].ToString();
                                SetProductDetail(this.grvStockin.Rows[e.RowIndex], Convert.ToDouble(dt.Rows[0]["LOID"]));
                                SetNewBarcodeFocus();
                            }
                            else
                            {
                                Appz.OpenErrorDialog("äÁ辺ÊÔ¹¤éÒµÒÁºÒÃìâ¤é´·ÕèÃкØ");
                                endEditBarcode = false;
                                return;
                            }
                        }
                    }
                }
                else if (e.ColumnIndex == indexQTY)
                {
                    if (this.grvStockin.Rows[e.RowIndex].Cells[indexQTY].Value.ToString().Trim() == "") this.grvStockin.Rows[e.RowIndex].Cells[indexQTY].Value = "1";

                    Calculate();
                    SetNewBarcodeFocus();
                }
            }
        }
Пример #18
0
        private void grvSupport_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            if (!this.grvSupport.Rows[e.RowIndex].IsNewRow && this.txtStatus.Text == Constz.Requisition.Status.Waiting.Code)
            {
                if (e.ColumnIndex == indexBARCODE)
                {
                    string barcode = (this.grvSupport.Rows[e.RowIndex].Cells[indexBARCODE].Value == null ? "" : this.grvSupport.Rows[e.RowIndex].Cells[indexBARCODE].Value.ToString().Trim());

                    if (barcode == "")
                    {
                        this.grvSupport.Rows[e.RowIndex].Cells[indexPRODUCT].Value = DBNull.Value;
                        this.grvSupport.Rows[e.RowIndex].Cells[indexUNIT].Value = DBNull.Value;
                        this.grvSupport.Rows[e.RowIndex].Cells[indexBARCODE].Value = DBNull.Value;
                        this.grvSupport.Rows[e.RowIndex].Cells[indexNAME].Value = DBNull.Value;
                        this.grvSupport.Rows[e.RowIndex].Cells[indexQTY].Value = DBNull.Value;
                        this.grvSupport.Rows[e.RowIndex].Cells[indexPRICE].Value = DBNull.Value;
                        this.grvSupport.Rows[e.RowIndex].Cells[indexDISCOUNT].Value = DBNull.Value;
                        this.grvSupport.Rows[e.RowIndex].Cells[indexNETPRICE].Value = DBNull.Value;
                        this.grvSupport.Rows[e.RowIndex].Cells[indexISVAT].Value = DBNull.Value;
                        this.grvSupport.Rows[e.RowIndex].Cells[indexNORMALDISCOUNT].Value = DBNull.Value;
                    }
                    else
                    {
                        if (barcode.Substring(0, 1) == "*")
                        {
                            this.grvSupport.Rows[e.RowIndex].Cells[indexPRODUCT].Value = DBNull.Value;
                            this.grvSupport.Rows[e.RowIndex].Cells[indexUNIT].Value = DBNull.Value;
                            this.grvSupport.Rows[e.RowIndex].Cells[indexBARCODE].Value = DBNull.Value;
                            this.grvSupport.Rows[e.RowIndex].Cells[indexNAME].Value = DBNull.Value;
                            this.grvSupport.Rows[e.RowIndex].Cells[indexQTY].Value = DBNull.Value;
                            this.grvSupport.Rows[e.RowIndex].Cells[indexPRICE].Value = DBNull.Value;
                            this.grvSupport.Rows[e.RowIndex].Cells[indexDISCOUNT].Value = DBNull.Value;
                            this.grvSupport.Rows[e.RowIndex].Cells[indexNETPRICE].Value = DBNull.Value;
                            this.grvSupport.Rows[e.RowIndex].Cells[indexISVAT].Value = DBNull.Value;
                            this.grvSupport.Rows[e.RowIndex].Cells[indexNORMALDISCOUNT].Value = DBNull.Value;

                            if (barcode.Length > 1)
                            {
                                barcode = barcode.Substring(1);
                                this.grvSupport.Rows[e.RowIndex].Cells[indexQTY].Value = Convert.ToDouble(barcode);
                            }
                            this.grvSupport.Rows[e.RowIndex].Cells[indexBARCODE].Value = "";
                            endEditBarcode = false;
                        }
                        else
                        {
                            SearchFlow search = new SearchFlow();
                            ABB.Data.Search.SearchProductData data = new ABB.Data.Search.SearchProductData();
                            data.CODE = barcode.Trim();
                            data.WAREHOUSE = Appz.CurrentUserData.Warehouse;
                            data.TYPE = Constz.ProductType.Type.FG.Code;
                            data.ZONE = Constz.Zone.Z11;
                            DataTable dt = search.GetProductList(data);
                            if (dt.Rows.Count == 1)
                            {
                                this.grvSupport.Rows[e.RowIndex].Cells[indexPRODUCT].Value = dt.Rows[0]["LOID"].ToString();
                                SetProductDetail(this.grvSupport.Rows[e.RowIndex], Convert.ToDouble(dt.Rows[0]["LOID"]));
                                SetNewBarcodeFocus();
                            }
                            else
                            {
                                Appz.OpenErrorDialog("äÁ辺ÊÔ¹¤éÒµÒÁºÒÃìâ¤é´·ÕèÃкØ");
                                endEditBarcode = false;
                                return;
                            }
                        }
                    }
                }
                else if (e.ColumnIndex == indexQTY)
                {
                    if (this.grvSupport.Rows[e.RowIndex].Cells[indexQTY].Value.ToString().Trim() == "") this.grvSupport.Rows[e.RowIndex].Cells[indexQTY].Value = "1";

                    CalculateGrandTotal();
                    SetNewBarcodeFocus();
                }
            }
        }
Пример #19
0
 private void txtCustomerCode_Leave(object sender, EventArgs e)
 {
     if (this.txtCustomerCode.Text.Trim() == "")
     {
         this.txtCustomerName.Text = "";
         this.txtCustomer.Text = "";
         CalculateGrandTotal();
     }
     else
     {
         SearchFlow search = new SearchFlow();
         ABB.Data.Search.SearchCustomerData data = new ABB.Data.Search.SearchCustomerData();
         data.CODE = this.txtCustomerCode.Text.Trim();
         data.FULLNAME = this.txtCustomerName.Text.Trim();
         DataTable dt = search.GetCustomerList(data);
         if (dt.Rows.Count == 1)
         {
             SetCustomerDetail(Convert.ToDouble(dt.Rows[0]["LOID"]));
         }
         else
         {
             foreach (DataRow dRow in dt.Rows)
             {
                 if (dRow["CODE"].ToString() == this.txtCustomerCode.Text.Trim())
                 {
                     if (this.txtCustomer.Text != dRow["LOID"].ToString())
                         SetCustomerDetail(Convert.ToDouble(dRow["LOID"]));
                     return;
                 }
             }
             SearchCustomer(this.txtCustomerCode.Text.Trim());
             if (Convert.ToDouble(this.txtCustomer.Text == "" ? "0" : this.txtCustomer.Text) <= 0)
                 return;//e.Cancel = true; ##by nang
         }
     }
 }
Пример #20
0
 private void txtRefCode_Leave(object sender, EventArgs e)
 {
     if (this.txtRefCode.Text.Trim() != "")
     {
         SearchFlow search = new SearchFlow();
         ABB.Data.Search.SearchSaleData data = new ABB.Data.Search.SearchSaleData();
         data.CODEFROM = this.txtRefCode.Text.Trim();
         data.CODETO = data.CODETO;
         DataTable dt = search.GetSaleList2(data);
         if (dt.Rows.Count == 1)
         {
             this.txtRefLOID.Text = dt.Rows[0]["LOID"].ToString();
             SetRefRequisition(Convert.ToDouble(this.txtRefLOID.Text));
         }
         else
         {
             Appz.OpenErrorDialog("äÁ辺àÅ¢·ÕèãºàÊÃ稷ÕèÍéÒ§ÍÔ§");
         }
         SetNewBarcodeFocus();
     }
     else
     {
         if (Convert.ToDouble(this.txtRefLOID.Text == "" ? "0" : this.txtRefLOID.Text) >0)
             ResetState(Convert.ToDouble(this.txtLOID.Text == "" ? "0" : this.txtLOID.Text));
     }
 }
Пример #21
0
        private void grvStockIn_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            if (!this.grvStockIn.Rows[e.RowIndex].IsNewRow)
            {
                if (e.ColumnIndex == indexBARCODE)
                {
                    string barcode = this.grvStockIn.Rows[e.RowIndex].Cells[indexBARCODE].Value.ToString();
                    if (barcode == "")
                    {
                        this.grvStockIn.Rows[e.RowIndex].Cells[indexPRODUCT].Value = DBNull.Value;
                        this.grvStockIn.Rows[e.RowIndex].Cells[indexUNIT].Value = DBNull.Value;
                        this.grvStockIn.Rows[e.RowIndex].Cells[indexBARCODE].Value = DBNull.Value;
                        this.grvStockIn.Rows[e.RowIndex].Cells[indexNAME].Value = DBNull.Value;
                        this.grvStockIn.Rows[e.RowIndex].Cells[indexQTY].Value = DBNull.Value;
                        this.grvStockIn.Rows[e.RowIndex].Cells[indexPRICE].Value = DBNull.Value;
                        this.grvStockIn.Rows[e.RowIndex].Cells[indexNETPRICE].Value = DBNull.Value;
                    }
                    else
                    {
                        if (barcode.Substring(0, 1) == "*")
                        {
                            this.grvStockIn.Rows[e.RowIndex].Cells[indexPRODUCT].Value = DBNull.Value;
                            this.grvStockIn.Rows[e.RowIndex].Cells[indexUNIT].Value = DBNull.Value;
                            this.grvStockIn.Rows[e.RowIndex].Cells[indexBARCODE].Value = DBNull.Value;
                            this.grvStockIn.Rows[e.RowIndex].Cells[indexNAME].Value = DBNull.Value;
                            this.grvStockIn.Rows[e.RowIndex].Cells[indexPRICE].Value = DBNull.Value;
                            this.grvStockIn.Rows[e.RowIndex].Cells[indexNETPRICE].Value = DBNull.Value;

                            if (barcode.Length > 1)
                            {
                                barcode = barcode.Substring(1);
                                this.grvStockIn.Rows[e.RowIndex].Cells[indexQTY].Value = Convert.ToDouble(barcode);
                            }
                            this.grvStockIn.Rows[e.RowIndex].Cells[indexBARCODE].Value = "";
                            endEditBarcode = false;
                        }
                        else
                        {
                            SearchFlow search = new SearchFlow();
                            ABB.Data.Search.SearchProductData data = new ABB.Data.Search.SearchProductData();
                            data.CODE = barcode.Trim();
                            data.WAREHOUSE = Appz.CurrentUserData.Warehouse;
                            DataTable dt = search.GetProductList(data);
                            if (dt.Rows.Count == 1)
                            {
                                this.grvStockIn.Rows[e.RowIndex].Cells[indexPRODUCT].Value = dt.Rows[0]["LOID"].ToString();
                                SetProductDetail(e.RowIndex, Convert.ToDouble(dt.Rows[0]["LOID"]));

                                if (!SetProductDuplicate(e.RowIndex, Convert.ToDouble(dt.Rows[0]["LOID"]), Convert.ToDouble(this.grvStockIn[indexQTY, e.RowIndex].Value)))
                                {
                                    CalculateProductItemNetPrice(this.grvStockIn.Rows[e.RowIndex]);
                                    CalculateGrandTotal();
                                }

                            }
                            else
                            {
                                Appz.OpenErrorDialog("äÁ辺ÊÔ¹¤éÒµÒÁºÒÃìâ¤é´·ÕèÃкØ");
                                return;
                            }
                        }
                    }
                }


                else if (e.ColumnIndex == indexQTY)
                {
                    if (this.grvStockIn.Rows[e.RowIndex].Cells[indexQTY].Value.ToString().Trim() == "") this.grvStockIn.Rows[e.RowIndex].Cells[indexQTY].Value = "1";

                    CalculateProductItemNetPrice(this.grvStockIn.Rows[e.RowIndex]);
                    CalculateGrandTotal();
                }
            }
        }