コード例 #1
0
        protected void btnConfirm_Click(object sender, EventArgs e)
        {
            try
            {
                BLBarcode blBarcode = new BLBarcode();
                string[]  hdText    = hdChkPO.Value.Split(',');
                bool      result    = false;
                var       users     = (User)Session["User"];

                foreach (string po in hdText)
                {
                    result = blBarcode.UpdateBarcodeByPO(po, users.DeptName, users.UserName);
                }

                if (result)
                {
                    actionResult = true;
                    msg          = "ยืนยันการรับทั้ง PO สำเร็จ";
                }
                else
                {
                    actionResult = false;
                    msg          = "เกิดข้อผิดพลาด!";
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
        protected void btnImport_OnClick(object sender, EventArgs e)
        {
            BLBarcode blBarcode = new BLBarcode();
            DataSet   ds        = new DataSet();
            bool      result    = false;

            try
            {
                var users = (User)Session["User"];
                ds = blBarcode.InsertBarcode(users.UserName, "");
                //result = blBarcode.ClearBarcodeTemp(HttpContext.Current.User.Identity.Name);

                actionResult = false;
                msg          = "เกิดข้อผิดพลาด!";

                if (ds.Tables.Count > 0)
                {
                    dtUpload = ds.Tables[0];

                    actionResult = true;
                    msg          = "บันทึกข้อมูลสำเร็จ";
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #3
0
        public static string ConfirmCreateTransfer(string trNo, string fromDept, string toDept, string startBar, string endBar, string qty, string transDate, string createBy)
        {
            BLBarcode blBarcode = new BLBarcode();
            bool      result    = false;
            DataTable dt        = new DataTable();
            string    str       = "";

            try
            {
                result = blBarcode.InsertBarcodeTransfer(trNo, fromDept, toDept, startBar, endBar, qty, transDate,
                                                         createBy);

                dt.Columns.Add("result");
                dt.Rows.Add("false");

                if (result)
                {
                    dt.Rows[0]["result"] = "true";
                }

                str = DataTableToJSONWithJavaScriptSerializer(dt);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(str);
        }
コード例 #4
0
        public static string ConfirmReceiveBarcode(string department, string trNo, string fromDept, string toDept, string barcodeStart, string barcodeEnd, string dateStart, string dateEnd, string updateBy)
        {
            string result = "";

            try
            {
                DataSet   dsBarTr   = new DataSet();
                DataSet   dsBarSt   = new DataSet();
                BLBarcode blBarcode = new BLBarcode();
                Utility   utility   = new Utility();
                bool      resultUps = false;
                //Get Transfer Barcode from TRNo
                if (!String.IsNullOrEmpty(trNo))
                {
                    dsBarTr = blBarcode.GetBarcodeTransfer(department, trNo, fromDept, toDept, barcodeStart, barcodeEnd, dateStart, dateEnd, "20");

                    //Update [QR_STOCK_BARCODE] set ststus = 2
                    if (dsBarTr.Tables.Count > 0)
                    {
                        if (dsBarTr.Tables[0].Rows.Count > 0)
                        {
                            dsBarSt = blBarcode.GetBarcodeByBarcode("",
                                                                    dsBarTr.Tables[0].Rows[0]["BARCODE_FROM"].ToString(),
                                                                    dsBarTr.Tables[0].Rows[0]["BARCODE_TO"].ToString());

                            if (dsBarSt.Tables.Count > 0)
                            {
                                foreach (DataRow dr in dsBarSt.Tables[0].Rows)
                                {
                                    resultUps = blBarcode.UpdateBarcodeByBarcode(dr["Barcode"].ToString(), department,
                                                                                 updateBy);
                                }
                            }
                        }
                    }
                }
                //21 = receive
                if (resultUps)
                {
                    resultUps = blBarcode.UpdateBarcodeTransfer(trNo, updateBy, "21", "");
                }

                DataTable dt = new DataTable();

                dt.Columns.Add("result");
                dt.Rows.Add("false");
                if (resultUps)
                {
                    dt.Rows[0]["result"] = "true";
                }

                result = utility.DataTableToJSONWithJavaScriptSerializer(dt);
            }
            catch (Exception ex)
            {
                //throw ex;
            }

            return(result);
        }
コード例 #5
0
        public static string ConfirmRejectBarcode(string trNo, string updateBy, string remark)
        {
            string result = "";

            try
            {
                Utility   utility   = new Utility();
                bool      resultUps = false;
                BLBarcode blBarcode = new BLBarcode();
                DataTable dt        = new DataTable();

                dt.Columns.Add("result");
                dt.Rows.Add("false");

                resultUps = blBarcode.UpdateBarcodeTransfer(trNo, updateBy, "22", remark);
                if (resultUps)
                {
                    dt.Rows[0]["result"] = "true";
                }

                result = utility.DataTableToJSONWithJavaScriptSerializer(dt);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(result);
        }
コード例 #6
0
        private void ImportToTable(string FilePath, string Extension, bool isHDR)
        {
            BLBarcode blBarcode = new BLBarcode();

            try
            {
                string conStr = "";
                switch (Extension)
                {
                case ".xls":
                    conStr = ConfigurationManager.ConnectionStrings["Excel03ConString"]
                             .ConnectionString;
                    break;

                case ".xlsx":
                    conStr = ConfigurationManager.ConnectionStrings["Excel07ConString"]
                             .ConnectionString;
                    break;
                }
                conStr = String.Format(conStr, FilePath, isHDR);
                OleDbConnection  connExcel = new OleDbConnection(conStr);
                OleDbCommand     cmdExcel  = new OleDbCommand();
                OleDbDataAdapter oda       = new OleDbDataAdapter();
                DataTable        dt        = new DataTable();
                cmdExcel.Connection = connExcel;

                //Get the name of First Sheet
                connExcel.Open();
                DataTable dtExcelSchema;
                dtExcelSchema = connExcel.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
                string SheetName = dtExcelSchema.Rows[0]["TABLE_NAME"].ToString();
                connExcel.Close();

                //Read Data from First Sheet
                connExcel.Open();
                cmdExcel.CommandText = "SELECT * From [" + SheetName + "]";
                oda.SelectCommand    = cmdExcel;
                oda.Fill(dt);
                connExcel.Close();

                var  users       = (User)Session["User"];
                bool resultClear = blBarcode.ClearBarcodeTemp(users.UserName);
                bool rsTmp       = blBarcode.InsertBarcodeToTemp(dt, users.UserName);

                if (rsTmp && resultClear)
                {
                    dtUpload = dt;
                    dtUpload.Columns.Add("STATUS", typeof(String));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["User"] == null)
            {
                Response.Redirect("~/Login.aspx");
            }

            if (!IsPostBack)
            {
                BLBarcode blBarcode = new BLBarcode();
                var       users     = (User)Session["User"];
                bool      result    = blBarcode.ClearBarcodeTemp(users.UserName);
            }
        }
コード例 #8
0
        protected void btnCancel_OnClick(object sender, EventArgs e)
        {
            BLBarcode blBarcode = new BLBarcode();
            bool      result    = false;

            try
            {
                var users = (User)Session["User"];
                result = blBarcode.ClearBarcodeTemp(users.UserName);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #9
0
        protected void SetInitialRow()
        {
            try
            {
                DataSet   ds        = new DataSet();
                BLBarcode blBarcode = new BLBarcode();
                ds = blBarcode.GetStockBarcode(txtBarcode.Text.Trim(), txtPoNo.Text.Trim(), txtEditStart.Text.Trim(),
                                               txtEditEnd.Text.Trim(), ddlDepartment.SelectedItem.Text, ddlStatus.SelectedValue);
                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        ViewState["gridStockBarcode"] = ds.Tables[0];
                        gridStockBarcode.DataSource   = ds.Tables[0];
                        gridStockBarcode.DataBind();
                    }
                }

                //DataTable dt = new DataTable();
                //DataRow dr = null;
                //dt.Columns.Add(new DataColumn("No", typeof(string)));
                //dt.Columns.Add(new DataColumn("Barcode", typeof(string)));
                //dt.Columns.Add(new DataColumn("PONo", typeof(string)));
                //dt.Columns.Add(new DataColumn("Department", typeof(string)));
                //dt.Columns.Add(new DataColumn("CreateDate", typeof(string)));
                //dt.Columns.Add(new DataColumn("LastEditDate", typeof(string)));
                //dt.Columns.Add(new DataColumn("LastEditBy", typeof(string)));
                //dt.Columns.Add(new DataColumn("Status", typeof(string)));
                //dr = dt.NewRow();
                //dr["No"] = 1;
                //dr["Barcode"] = string.Empty;
                //dr["PONo"] = string.Empty;
                //dr["Department"] = string.Empty;
                //dr["CreateDate"] = string.Empty;
                //dr["LastEditDate"] = string.Empty;
                //dr["LastEditBy"] = string.Empty;
                //dr["Status"] = string.Empty;
                //dt.Rows.Add(dr);

                //ViewState["gridStockBarcode"] = dt;
                //gridStockBarcode.DataSource = dt;
                //gridStockBarcode.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #10
0
        public static string GetBarcodeByBarcode(string po, string barcodeStart, string barcodeEnd)
        {
            BLBarcode blBarcode = new BLBarcode();
            DataSet   ds        = new DataSet();
            string    result    = "";

            try
            {
                ds     = blBarcode.GetBarcodeByBarcode(po, barcodeStart, barcodeEnd);
                result = DataTableToJSONWithJavaScriptSerializer(ds.Tables[0]);
            }
            catch (Exception ex)
            {
            }
            return(result);
        }
コード例 #11
0
        private void SetDataTransfer(string department, string trNo)
        {
            try
            {
                DataSet   ds        = new DataSet();
                BLBarcode blBarcode = new BLBarcode();
                ds = blBarcode.GetBarcodeTransfer(department, trNo, "", "", "", "", "", "", "");
                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        foreach (DataRow dr in ds.Tables[0].Rows)
                        {
                            txtTranferNo.InnerText = dr["TR_NO"].ToString();
                            hdFromDept.Value       = dr["TR_FROM"].ToString();
                            hdToDept.Value         = dr["TR_TO"].ToString();
                            txtBarcodeStart.Value  = dr["BARCODE_FROM"].ToString();
                            txtBarcodeEnd.Value    = dr["BARCODE_TO"].ToString();
                            lbBarcodeQty.InnerText = dr["TOTAL_QTY"].ToString();
                            if (!String.IsNullOrEmpty(dr["TR_DATE"].ToString()))
                            {
                                DateTime dt = Convert.ToDateTime(dr["TR_DATE"].ToString());
                                txtTfDate.Value = dt.Day.ToString() + '/' + dt.Month.ToString() + '/' + dt.Year.ToString();
                            }
                            if (!String.IsNullOrEmpty(dr["RECEIVE_DATE"].ToString()))
                            {
                                DateTime dt = Convert.ToDateTime(dr["RECEIVE_DATE"].ToString());
                                txtRcDate.InnerText = dt.Day.ToString() + '/' + dt.Month.ToString() + '/' + dt.Year.ToString();
                            }


                            lbStatus.InnerText = dr["STATUS_NAME"].ToString();

                            if (dr["STATUS_ID"].ToString().Trim() != "20")
                            {
                                btnConfirmReceive.Visible = false;
                                btnRejectReceive.Visible  = false;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #12
0
        public static string GetStockBarcode(string barcode, string poNo, string lastEditStart, string lastEditEnd, string department, string status)
        {
            BLBarcode blBarcode = new BLBarcode();
            DataSet   ds        = new DataSet();
            Utility   utility   = new Utility();
            string    result    = "";

            try
            {
                ds     = blBarcode.GetStockBarcode(barcode, poNo, lastEditStart, lastEditEnd, department, status);
                result = utility.DataTableToJSONWithJavaScriptSerializer(ds.Tables[0]);
            }
            catch (Exception ex)
            {
            }
            return(result);
        }
コード例 #13
0
        public static string GetBarcodeTransfer(string department, string trNo, string fromDept, string toDept, string barcodeStart, string barcodeEnd, string dateStart, string dateEnd, string status)
        {
            string result = "";

            try
            {
                DataSet   ds        = new DataSet();
                BLBarcode blBarcode = new BLBarcode();
                Utility   utility   = new Utility();
                ds     = blBarcode.GetBarcodeTransfer(department, trNo, fromDept, toDept, barcodeStart, barcodeEnd, dateStart, dateEnd, status);
                result = utility.DataTableToJSONWithJavaScriptSerializer(ds.Tables[0]);
            }
            catch (Exception ex)
            {
                //throw ex;
            }

            return(result);
        }
コード例 #14
0
        public static string GetTrRunningNo()
        {
            DataSet   ds        = new DataSet();
            BLBarcode blBarcode = new BLBarcode();
            string    result    = "";
            Utility   utility   = new Utility();

            try
            {
                ds     = blBarcode.GetTrRunningNo();
                result = utility.DataTableToJSONWithJavaScriptSerializer(ds.Tables[0]);
            }
            catch (Exception ex)
            {
                //throw ex;
            }

            return(result);
        }
コード例 #15
0
 protected void btnSearch_OnServerClick(object sender, EventArgs e)
 {
     try
     {
         DataSet   ds        = new DataSet();
         BLBarcode blBarcode = new BLBarcode();
         ds = blBarcode.GetStockBarcode(txtBarcode.Text.Trim(), txtPoNo.Text.Trim(), txtEditStart.Text.Trim(),
                                        txtEditEnd.Text.Trim(), ddlDepartment.SelectedItem.Text, ddlStatus.SelectedValue);
         //if (ds.Tables.Count > 0)
         //{
         //    if (ds.Tables[0].Rows.Count > 0)
         //    {
         ViewState["gridStockBarcode"] = ds.Tables[0];
         gridStockBarcode.DataSource   = ds.Tables[0];
         gridStockBarcode.DataBind();
         //    }
         //}
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #16
0
        protected void btnSave_ServerClick(object sender, EventArgs e)
        {
            try
            {
                bool      result    = false;
                BLBarcode blBarcode = new BLBarcode();
                string    barcode   = "";

                var users = (User)Session["User"];

                if (ViewState["gridBarcodeScan"] != null)
                {
                    DataTable dt = (DataTable)ViewState["gridBarcodeScan"];

                    foreach (DataRow dr in dt.Rows)
                    {
                        barcode = barcode + dr["Barcode"].ToString() + ",";
                    }

                    barcode = barcode.Substring(0, barcode.Length - 1);
                }

                result = blBarcode.InsertBarcodeShipment(hdShipId.Value, barcode, users.UserName, users.DeptName);

                if (result)
                {
                    var       spBarcode = barcode.Split(',');
                    DataTable dt        = (DataTable)ViewState["gridBarcodeScan"];
                    foreach (var bc in spBarcode)
                    {
                        DataSet ds = blBarcode.GetBarcodeShipment(hdShipId.Value, bc);

                        foreach (DataRow dr in dt.Rows)
                        {
                            if (dr["Barcode"].ToString().Equals(bc))
                            {
                                dr["Status"] = ds.Tables[0].Rows[0]["STATUS"];
                            }
                        }
                    }

                    ViewState["gridBarcodeScan"] = dt;
                    //ViewState["gridBarcodeScan"] = null;
                    gridBarcodeScan.Columns[3].Visible = true;
                    gridBarcodeScan.Columns[2].Visible = false;

                    gridBarcodeScan.DataSource = dt;
                    gridBarcodeScan.DataBind();

                    var countVoid = 0;
                    foreach (GridViewRow item in gridBarcodeScan.Rows)
                    {
                        var status = item.Cells[3].Text;

                        if (status.Equals("OK"))
                        {
                            item.Cells[3].Style["background-color"] = "green";
                            countVoid++;
                        }
                        else
                        {
                            item.Cells[3].Style["background-color"] = "red";
                        }
                    }

                    gridBarcodeScan.HeaderRow.Cells[0].CssClass = "visiblecol";

                    btnSaveTmp.Visible = false;
                    btnSave.Visible    = false;
                    btnCancel.Visible  = false;
                    btnBack.Visible    = true;

                    var voidQty   = Convert.ToInt32(lbVoidQty.InnerText);
                    var scanQty   = Convert.ToInt32(lbScanQty.InnerText) + countVoid;
                    var remainQty = voidQty - scanQty;

                    lbScanQty.InnerText   = scanQty.ToString();
                    lbRemainQty.InnerText = remainQty.ToString();

                    lbBarcode.Style["display"]      = "none";
                    txtBarcodeScan.Style["display"] = "none";

                    actionResult = true;
                    msg          = "บันทึกข้อมูลสำเร็จ";
                }
                else
                {
                    actionResult = false;
                    msg          = "เกิดข้อผิดพลาด กรุณาตรวจสอบ!";
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #17
0
        protected void btnSave_ServerClick(object sender, EventArgs e)
        {
            try
            {
                bool      result    = false;
                BLBarcode blBarcode = new BLBarcode();
                string    barcode   = "";

                var users = (User)Session["User"];

                if (ViewState["gridBarcodeScan"] != null)
                {
                    DataTable dt = (DataTable)ViewState["gridBarcodeScan"];

                    foreach (DataRow dr in dt.Rows)
                    {
                        barcode = barcode + dr["Barcode"].ToString() + ",";
                    }

                    barcode = barcode.Substring(0, barcode.Length - 1);
                }

                result = blBarcode.InsertBarcodeVoidTintOneShot(barcode, users.UserName, users.DeptName);

                if (result)
                {
                    var       spBarcode = barcode.Split(',');
                    DataTable dt        = (DataTable)ViewState["gridBarcodeScan"];
                    foreach (var bc in spBarcode)
                    {
                        DataSet ds = blBarcode.GetBarcodeVoidTintOneShot(bc);

                        foreach (DataRow dr in dt.Rows)
                        {
                            if (dr["Barcode"].ToString().Equals(bc))
                            {
                                dr["Status"] = ds.Tables[0].Rows[0]["STATUS"];
                            }
                        }
                    }

                    ViewState["gridBarcodeScan"] = dt;
                    //ViewState["gridBarcodeScan"] = null;
                    gridBarcodeScan.Columns[3].Visible = true;
                    gridBarcodeScan.Columns[2].Visible = false;

                    gridBarcodeScan.DataSource = dt;
                    gridBarcodeScan.DataBind();

                    gridBarcodeScan.HeaderRow.Cells[0].CssClass = "visiblecol";

                    btnSave.Visible   = false;
                    btnCancel.Visible = false;
                    btnBack.Visible   = true;

                    actionResult = true;
                    msg          = "บันทึกข้อมูลสำเร็จ";
                }
                else
                {
                    actionResult = false;
                    msg          = "เกิดข้อผิดพลาด กรุณาตรวจสอบ!";
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #18
0
        protected void txtBarcodeScan_OnTextChanged(object sender, EventArgs e)
        {
            int rowIndex = 0;

            try
            {
                if (!String.IsNullOrEmpty(txtBarcodeScan.Text) && txtBarcodeScan.Text.Length == 11 && IsDigitsOnly(txtBarcodeScan.Text))
                {
                    BLBarcode blBarcode = new BLBarcode();
                    DataSet   ds        = blBarcode.GetBarcodeVoidTintOneShot(txtBarcodeScan.Text.Trim());

                    if (ViewState["gridBarcodeScan"] != null)
                    {
                        DataTable dt = (DataTable)ViewState["gridBarcodeScan"];
                        DataRow   dr = null;


                        if (dt.Rows.Count > 0)
                        {
                            if (!IsDupplicateBarcode(dt, txtBarcodeScan.Text) && ds.Tables[0].Rows.Count == 0)
                            {
                                dr            = dt.NewRow();
                                dr["No"]      = dt.Rows.Count + 1;
                                dr["Barcode"] = txtBarcodeScan.Text;

                                dt.Rows.Add(dr);

                                ViewState["gridBarcodeScan"] = dt;

                                gridBarcodeScan.DataSource = dt;
                                gridBarcodeScan.DataBind();

                                actionResult = true;
                            }
                            else
                            {
                                //Barcode Dupplicate
                                actionResult = false;
                                msg          = "Barcode ถูกยิงไปแล้ว กรุณาลองใหม่!";
                            }
                        }
                        else
                        {
                            if (ds.Tables[0].Rows.Count == 0)
                            {
                                //after delete all
                                SetInitialRow(txtBarcodeScan.Text);
                                actionResult = true;
                            }
                            else
                            {
                                //Barcode Dupplicate
                                actionResult = false;
                                msg          = "Barcode ถูกยิงไปแล้ว กรุณาลองใหม่!";
                            }
                        }
                    }
                    else
                    {
                        if (ds.Tables[0].Rows.Count == 0)
                        {
                            //First Record
                            SetInitialRow(txtBarcodeScan.Text);
                            actionResult = true;
                        }
                        else
                        {
                            //Barcode Dupplicate
                            actionResult = false;
                            msg          = "Barcode ถูกยิงไปแล้ว กรุณาลองใหม่!";
                        }
                    }

                    if (gridBarcodeScan.Rows.Count > 0 || actionResult)
                    {
                        btnSave.Visible   = true;
                        btnCancel.Visible = true;
                    }
                    else
                    {
                        btnSave.Visible   = false;
                        btnCancel.Visible = false;
                    }
                }
                else
                {
                    //Barcode invalid
                    actionResult = false;
                    msg          = "รูปแบบ Barcode ไม่ถูกต้อง กรุณาลองใหม่!";
                }

                //Set Focus
                txtBarcodeScan.Focus();
                txtBarcodeScan.Text = "";
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #19
0
        private void SetGridData(string shipmentNo)
        {
            try
            {
                BLBarcode blBarcode = new BLBarcode();
                DataSet   ds        = new DataSet();
                DataTable dt        = InitialTable();
                ds = blBarcode.GetShipment(shipmentNo);

                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        DataRow dtr;
                        foreach (DataRow dr in ds.Tables[0].Rows)
                        {
                            dtr = dt.NewRow();
                            dtr["ShipmentId"] = dr["SHIP_ID"].ToString();
                            dtr["ShipmentNo"] = dr["SHIP_NO"].ToString();
                            dtr["BTFS"]       = dr["BTFS"].ToString();
                            dtr["VoidQty"]    = dr["VOID_QTY"].ToString();
                            dtr["ScanQty"]    = dr["SCAN_QTY"].ToString();
                            dtr["Material"]   = dr["MAT_NO"].ToString();
                            dtr["MatDesc"]    = dr["MAT_DESC"].ToString();
                            dtr["BatchNo"]    = dr["BATCH_NO"].ToString();
                            if (!String.IsNullOrEmpty(dr["CREATE_DATE"].ToString()))
                            {
                                DateTime dti = Convert.ToDateTime(dr["CREATE_DATE"].ToString());
                                dtr["CreateDate"] = dti.Day.ToString() + '/' + dti.Month.ToString() + '/' + dti.Year.ToString();
                            }
                            //dtr["CreateDate"] = dr["CREATE_DATE"].ToString();
                            dtr["Status"] = dr["STATUS_NAME"].ToString();

                            dt.Rows.Add(dtr);
                        }
                    }
                }

                ViewState["gridShipment"] = dt;
                gridShipment.DataSource   = dt;
                gridShipment.DataBind();

                foreach (GridViewRow item in gridShipment.Rows)
                {
                    var voidQty = !IsDigitsOnly(item.Cells[4].Text) ? 0 : Convert.ToInt32(item.Cells[4].Text);
                    var scanQty = !IsDigitsOnly(item.Cells[5].Text) ? 0 : Convert.ToInt32(item.Cells[5].Text);

                    if (voidQty == scanQty)
                    {
                        item.Cells[4].Style["background-color"] = "green";
                        item.Cells[5].Style["background-color"] = "green";

                        //Field Button Scan
                        //item.Cells[1].Visible = false;
                    }
                    else
                    {
                        item.Cells[4].Style["background-color"] = "orange";
                        item.Cells[5].Style["background-color"] = "orange";
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }