protected void btnOK_Click(object sender, EventArgs e)
 {
     if (IsValid)
     {
         txtPayment.Text = txtPayment.Text == "" ? "0" : txtPayment.Text;
         double Payment = Convert.ToDouble(txtPayment.Text);
         if (Request.QueryString["ShipmentNo_"] != null)
         {
             int shipmentNo_ = Convert.ToInt32(Request.QueryString["ShipmentNo_"]);
             DTO.SAM_Shipment sam_Shipment = BUS.SAM_Shipment.GetByID(shipmentNo_);
             DTO.FIC_Inc_Exp_Document inc_Exp_Document = new DTO.FIC_Inc_Exp_Document();
             inc_Exp_Document.ReferenceNo_ = shipmentNo_;
             inc_Exp_Document.Inc_Exp_Value = Payment;
             inc_Exp_Document.Inc_Exp_FormNo_ = "";
             if (inc_Exp_Document.Inc_Exp_Value > (sam_Shipment.Quantity * sam_Shipment.UnitPrice))
                 inc_Exp_Document.Inc_Exp_Value = (sam_Shipment.Quantity * sam_Shipment.UnitPrice);
             if (BUS.FIC_Inc_Exp_Document.Create(inc_Exp_Document) > 0)
             {
                 if (((Master_MasterPage)this.Master).MenuName == Menu.DriverShipmentDetailPayment)
                 {
                     Response.Redirect("");
                 }
                 else
                 {
                     Response.Redirect(Page.ResolveUrl(String.Format("~/quan-ly-lenh-dieu-dong-van-chuyen/{0}/{1}.html", sam_Shipment.OrderNo_, sam_Shipment.ShipmentNo_)));
                 }
             }
         }
     }
 }
 protected void btnOK_Click(object sender, EventArgs e)
 {
     if (IsValid)
     {
         txtPayment.Text = txtPayment.Text == "" ? "0" : txtPayment.Text;
         double Payment = Convert.ToDouble(txtPayment.Text);
         if (Request.QueryString["ShipmentNo_"] != null)
         {
             int shipmentNo_ = Convert.ToInt32(Request.QueryString["ShipmentNo_"]);
             DTO.SAM_Shipment sam_Shipment = BUS.SAM_Shipment.GetByID(shipmentNo_);
             DTO.FIC_Inc_Exp_Document inc_Exp_Document = new DTO.FIC_Inc_Exp_Document();
             inc_Exp_Document.ReferenceNo_ = shipmentNo_;
             inc_Exp_Document.Inc_Exp_Value = Payment;
             inc_Exp_Document.Inc_Exp_FormNo_ = ddlInc_Exp_FormNo_.SelectedItem.Value;
             if (BUS.FIC_Inc_Exp_Document.Create(inc_Exp_Document) > 0)
             {
                 LoadDataList();
             }
         }
     }
 }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        if (IsValid)
        {
            lbInfo.Text = "";
            DTO.FIC_Inc_Exp_Document item = new DTO.FIC_Inc_Exp_Document();
            item.Inc_Exp_FormNo_ = ddlInc_Exp_FormNo_.SelectedItem.Value;
            item.ReferenceNo_ = 0;
            item.Inc_Exp_Value = Convert.ToInt32(txtInc_Exp_Value.Text);
            if (BUS.FIC_Inc_Exp_Document.Create(item) > 0)
            {
                txtInc_Exp_Value.Text = "0";
                lbInfo.CssClass = "label label-success";
                lbInfo.Text = String.Format("Đã thêm thành công: {0} - {1} - {2}", rbPhieuChi.Checked ? "Phiếu chi" : "Phiếu thu", ddlInc_Exp_FormNo_.SelectedItem.Text, item.Inc_Exp_Value.ToString("N0"));
            }
            else
            {
                lbInfo.CssClass = "label label-danger";
                lbInfo.Text = "Thêm không thành công";
            }

        }
    }