void BindData()
        {
            var empNo = CommonWeb.GetCurrentEmployeeNo();
            var datas = orderControls.GetOrdersForBatch(empNo);

            GvData.DataSource = datas;
            GvData.DataBind();
        }
예제 #2
0
        async void LoadGridBatch(string NoBalitTanah = "")
        {
            var empNo = CommonWeb.GetCurrentEmployeeNo();
            var ret   = await orderControls.GetBatchDataByPIC(empNo);

            var datas = ret;

            if (datas != null)
            {
                GvBatch.DataSource = datas;
                GvBatch.DataBind();
            }

            if (GvBatch.Rows.Count > 0)
            {
                GvBatch.UseAccessibleHeader    = true;
                GvBatch.HeaderRow.TableSection = TableRowSection.TableHeader;
            }
        }
        void SimpanData()
        {
            var LastNum    = CounterGen.Increment("BATCHNO");
            var NewBatchNo = GenerateNoBatch(LastNum);
            var curDate    = DateTime.Now;
            var newBatch   = new batchtbl()
            {
                status = "Proses", batchId = NewBatchNo, creaBy = CommonWeb.GetCurrentUser(), creaDate = curDate, modBy = CommonWeb.GetCurrentUser(), modDate = curDate, pic_analis = Convert.ToInt32(CmbPIC.SelectedValue), pic_penyelia = CommonWeb.GetCurrentEmployeeNo()
            };
            var listOrderNo = new List <string>();

            foreach (GridViewRow row in GvData.Rows)
            {
                var chk = row.FindControl("ChkPilih") as CheckBox;
                if (chk != null && chk.Checked)
                {
                    var orderNo = row.Cells[1].Text;
                    listOrderNo.Add(orderNo);
                }
            }
            if (listOrderNo.Count > 0)
            {
                var res = orderControls.SimpanDataBatch(newBatch, listOrderNo);
                if (res)
                {
                    Response.Redirect("DaftarPesanan.aspx");
                }
            }
            else
            {
                CommonWeb.Alert(this, "Silakan pilih order terlebih dahulu");
            }
        }