Example #1
0
    private void SetData(InvoiceRequestData data)
    {
        if (data.LOID == 0)
        {
            data.REQDATE = DateTime.Today;
            data.STATUS = Constz.Requisition.Status.Waiting.Code;
            data.CREATEBY = Authz.CurrentUserInfo.UserID;
        }
        this.txtLOID.Text = data.LOID.ToString();
        this.txtAddress.Text = data.CADDRESS;
        this.txtFax.Text = data.CFAX;
        this.txtLastName.Text = data.CLASTNAME;
        this.txtName.Text = data.CNAME;
        this.txtRequisitionCode.Text = data.CODE;
        this.txtCreateBy.Text = data.CREATEBY;
        this.txtTel.Text = data.CTEL;
        this.cmbTitle.SelectedIndex = this.cmbTitle.Items.IndexOf(this.cmbTitle.Items.FindByValue(data.CTITLE.ToString()));
        this.txtCustomer.Text = data.CUSTOMER.ToString();
        this.txtGrandTotal.Text = data.GRANDTOT.ToString(Constz.DblFormat);
        this.txtOldTotal.Text = data.OLDTOTAL.ToString(Constz.DblFormat);
        this.txtReason.Text = data.REASON;
        this.txtRemark.Text = data.REMARK;
        this.txtRefLoid.Text = data.REFLOID.ToString();
        this.ctlReqDate.DateValue = data.REQDATE;
        this.txtStatus.Text = data.STATUS;
        this.txtStatusName.Text = Appz.GetStatusName(data.STATUS);
        this.txtTotal.Text = data.TOTAL.ToString(Constz.DblFormat);
        this.txtTotalDiscount.Text = data.TOTDIS.ToString(Constz.DblFormat);
        this.txtTotalVat.Text = data.TOTVAT.ToString(Constz.DblFormat);
        this.txtVat.Text = data.VAT.ToString(Constz.IntFormat);
        this.txtWareHouse.Text = data.WAREHOUSE.ToString();
        this.txtDifference.Text = data.TOTDIS.ToString(Constz.DblFormat);
        this.txtInvoicecode.Text = data.INVCODE;
        this.txtCustomerCode.Text = data.CUSTOMERCODE;
        this.txtCustomerName.Text = data.CUSTOMERNAME;

        SetGrvItem(data.STATUS);

        if (data.STATUS != Constz.Requisition.Status.Waiting.Code)
        {
            this.ctlToolbar.BtnSaveShow = false;
            this.ctlToolbar.BtnCancelShow = false;
            this.ctlToolbar.BtnSubmitShow = false;
        }
        this.ctlToolbar.ClientClickPrint = ABB.Global.Appz.ReportScript(Constz.Report.ReturnRequest, data.LOID) + " return false;";
    }
Example #2
0
 public InvoiceRequestData GetInvoiceData(double requisition)
 {
     InvoiceRequestData data = new InvoiceRequestData();
     DataTable dt = SearchObj.GetOldInvoiceRequest(requisition);
     if (dt.Rows.Count == 1)
     {
         DataRow dRow = dt.Rows[0];
         if (!Convert.IsDBNull(dRow["CADDRESS"])) data.CADDRESS = dRow["CADDRESS"].ToString();
         if (!Convert.IsDBNull(dRow["CFAX"])) data.CFAX = dRow["CFAX"].ToString();
         if (!Convert.IsDBNull(dRow["CLASTNAME"])) data.CLASTNAME = dRow["CLASTNAME"].ToString();
         if (!Convert.IsDBNull(dRow["CNAME"])) data.CNAME = dRow["CNAME"].ToString();
         if (!Convert.IsDBNull(dRow["CODE"])) data.CODE = dRow["CODE"].ToString(); ;
         if (!Convert.IsDBNull(dRow["CREATEBY"])) data.CREATEBY = dRow["CREATEBY"].ToString(); ;
         if (!Convert.IsDBNull(dRow["CTEL"])) data.CTEL = dRow["CTEL"].ToString(); ;
         if (!Convert.IsDBNull(dRow["CTITLE"])) data.CTITLE = Convert.ToDouble(dRow["CTITLE"]);
         if (!Convert.IsDBNull(dRow["CUSTOMER"])) data.CUSTOMER = Convert.ToDouble(dRow["CUSTOMER"]);
         if (!Convert.IsDBNull(dRow["GRANDTOT"])) data.GRANDTOT = Convert.ToDouble(dRow["GRANDTOT"]);
         if (!Convert.IsDBNull(dRow["LOID"])) data.LOID = Convert.ToDouble(dRow["LOID"]);
         if (!Convert.IsDBNull(dRow["OLDTOTAL"])) data.OLDTOTAL = Convert.ToDouble(dRow["OLDTOTAL"]);
         if (!Convert.IsDBNull(dRow["REASON"])) data.REASON = dRow["REASON"].ToString();
         if (!Convert.IsDBNull(dRow["REFLOID"])) data.REFLOID = Convert.ToDouble(dRow["REFLOID"]);
         if (!Convert.IsDBNull(dRow["REMARK"])) data.REMARK = dRow["REMARK"].ToString(); ;
         if (!Convert.IsDBNull(dRow["REQDATE"])) data.REQDATE = Convert.ToDateTime(dRow["REQDATE"]);
         if (!Convert.IsDBNull(dRow["STATUS"])) data.STATUS = dRow["STATUS"].ToString(); ;
         if (!Convert.IsDBNull(dRow["TOTAL"])) data.TOTAL = Convert.ToDouble(dRow["TOTAL"]);
         if (!Convert.IsDBNull(dRow["TOTDIS"])) data.TOTDIS = Convert.ToDouble(dRow["TOTDIS"]);
         if (!Convert.IsDBNull(dRow["TOTVAT"])) data.TOTVAT = Convert.ToDouble(dRow["TOTVAT"]);
         if (!Convert.IsDBNull(dRow["VAT"])) data.VAT = Convert.ToDouble(dRow["VAT"]);
         if (!Convert.IsDBNull(dRow["WAREHOUSE"])) data.WAREHOUSE = Convert.ToDouble(dRow["WAREHOUSE"]);
         if (!Convert.IsDBNull(dRow["INVCODE"])) data.INVCODE = dRow["INVCODE"].ToString(); ;
         if (!Convert.IsDBNull(dRow["CUSTOMERCODE"])) data.CUSTOMERCODE = dRow["CUSTOMERCODE"].ToString(); ;
         if (!Convert.IsDBNull(dRow["CUSTOMERNAME"])) data.CUSTOMERNAME = dRow["CUSTOMERNAME"].ToString(); ;
     }
     data.OLDITEMS = SearchObj.GetInvoiceItemList(requisition);
     int i = 1;
     foreach (DataRow dRow in data.OLDITEMS.Rows)
     {
         dRow["RANK"] = i;
         ++i;
     }
     return data;
 }