Esempio n. 1
0
    protected void btnget_Click(object sender, EventArgs e)
    {
        stDS            = new DataSet();
        docno.InnerHtml = txtDocno.Text.Trim();
        stDS            = CnFInvoice.GetInvoiceDetails(Convert.ToInt32(txtDocno.Text), "print", Convert.ToInt32(strFY));

        RepDetailsApprove.DataSource = stDS.Tables[1];
        RepDetailsApprove.DataBind();
    }
Esempio n. 2
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        CnFInvoice _objInvoice = new CnFInvoice();

        _objInvoice.CnFId = Convert.ToInt32(ddlCnF.SelectedValue.ToString());
        string date1;
        string lrdate;

        if (txtdocDate.Text == "")
        {
            date1 = "1/1/2001";
        }
        else
        {
            date1 = txtdocDate.Text.Split('/')[2] + "/" + txtdocDate.Text.Split('/')[1] + "/" + txtdocDate.Text.Split('/')[0];
        }
        if (txtLRDate.Text == "")
        {
            lrdate = "1/1/2001";
        }
        else
        {
            lrdate = txtLRDate.Text.Split('/')[2] + "/" + txtLRDate.Text.Split('/')[1] + "/" + txtLRDate.Text.Split('/')[0];
        }
        _objInvoice.DocumentNo  = Convert.ToInt32(txtDocno.Text.ToString());
        _objInvoice.InvoiceDate = Convert.ToDateTime(date1);
        _objInvoice.LRDate      = Convert.ToDateTime(lrdate);
        _objInvoice.LRNo        = txtlrno.Text.Trim();
        _objInvoice.Remark1     = txtremark.Text.Trim();
        _objInvoice.Transporter = txttransporter.Text.Trim();
        _objInvoice.CreatedBy   = Session["UserName"].ToString();
        string strdetails = "";

        //if (ViewState["CurrentTable"] != null)
        //{
        //    DataTable dt = (DataTable)ViewState["CurrentTable"];
        //    strdetails = ConvertDatatableToXML(dt);
        //}
        DataTable dt = setStateGridview();

        dt.TableName        = "mytable";
        strdetails          = ConvertDatatableToXML(dt).ToString();
        _objInvoice.Details = strdetails.ToString();

        // _objInvoice.NewDetails = ConvertDatatableToXML(GetDataTable(grdBookDetails)).ToString(); ;
        _objInvoice.flag = "I";
        _objInvoice.FinancialYearFrom = Convert.ToInt32(Session["FY"].ToString());
        _objInvoice.UpdateCnFInvoice();
        ClearAll();
        MessageBox("Record updated successfully , Doument No. : " + txtDocno.Text.ToString());
    }
Esempio n. 3
0
 protected void btnget_Click(object sender, EventArgs e)
 {
     pnlDetails.Visible = true;
     stDS = new DataSet();
     //   docno.InnerHtml = txtDocno.Text.Trim();
     stDS = CnFInvoice.GetInvoiceDetails(Convert.ToInt32(txtDocno.Text), "print", Convert.ToInt32(strFY));
     ddlCnF.SelectedValue   = stDS.Tables[1].Rows[0]["CustId"].ToString();
     txtLRDate.Text         = stDS.Tables[1].Rows[0]["LRDate"].ToString();
     txtdocDate.Text        = stDS.Tables[1].Rows[0]["Invoicedate"].ToString();
     txttransporter.Text    = stDS.Tables[1].Rows[0]["Transporter"].ToString();
     lblDocumentno.Text     = stDS.Tables[1].Rows[0]["DocumentNo"].ToString();
     grdapproval.DataSource = stDS.Tables[0];
     grdapproval.DataBind();
     //  SetInitialRow();
 }
Esempio n. 4
0
    protected void grdapproval_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        CnFInvoice _objinvoice = new CnFInvoice();

        invoiceId = Convert.ToInt32(((Label)grdapproval.Rows[e.RowIndex].FindControl("lblivoiceId")).Text);

        _objinvoice.IsDeleted = true;
        _objinvoice.IsActive  = false;
        _objinvoice.CnFId     = invoiceId;
        _objinvoice.DeleteCnFInvoice();

        stDS = CnFInvoice.GetInvoiceDetails(Convert.ToInt32(txtDocno.Text), "print", Convert.ToInt32(strFY));
        grdapproval.DataSource = stDS.Tables[0];
        grdapproval.DataBind();
    }
Esempio n. 5
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        btn_Save.Enabled = false;
        CnFInvoice _objInvoice = new CnFInvoice();

        _objInvoice.CnFId = Convert.ToInt32(ddlCnF.SelectedValue.ToString());
        string date1;
        string lrdate;

        if (txtdocDate.Text == "")
        {
            date1 = "1/1/2001";
        }
        else
        {
            date1 = txtdocDate.Text.Split('/')[1] + "/" + txtdocDate.Text.Split('/')[0] + "/" + txtdocDate.Text.Split('/')[2];
        }
        if (txtLRDate.Text == "")
        {
            lrdate = "1/1/2001";
        }
        else
        {
            lrdate = txtLRDate.Text.Split('/')[1] + "/" + txtLRDate.Text.Split('/')[0] + "/" + txtLRDate.Text.Split('/')[2];
        }

        _objInvoice.InvoiceDate = Convert.ToDateTime(date1);
        _objInvoice.LRDate      = Convert.ToDateTime(lrdate);
        _objInvoice.LRNo        = txtlrno.Text.Trim();
        _objInvoice.Remark1     = txtremark.Text.Trim();
        _objInvoice.Transporter = txttransporter.Text.Trim();
        _objInvoice.CreatedBy   = Session["UserName"].ToString();
        string strdetails = "";

        if (ViewState["CurrentTable"] != null)
        {
            DataTable dt = (DataTable)ViewState["CurrentTable"];
            strdetails = ConvertDatatableToXML(dt);
        }
        _objInvoice.Details           = strdetails;
        _objInvoice.flag              = "I";
        _objInvoice.FinancialYearFrom = Convert.ToInt32(Session["FY"].ToString());
        _objInvoice.Save(out DocNo);
        ClearAll();
        MessageBox("Record saved successfully , Doument No. : " + DocNo.ToString());
        btn_Save.Enabled = true;
    }
    public void bindReport()
    {
        if (Request.QueryString["d"] != null)
        {
            DataTable dt  = new DataTable();
            DataTable dt1 = new DataTable();
            dt = CnFInvoice.GetInvoiceDetails(Convert.ToInt32(Request.QueryString["d"].ToString()), "print", Convert.ToInt32(Request.QueryString["fy"].ToString())).Tables[0];

            ReportDocument rd = new ReportDocument();

            rd.Load(Server.MapPath("../report/C_PrintInvoice.rpt"));

            rd.Database.Tables[0].SetDataSource(dt);
            //  rd.Database.Tables[1].SetDataSource(dt1);
            //  rd.Database.Tables[2].SetDataSource(ds1.Tables[0]);
            // rd.SetDataSource(dt);
            //   rd.SetDataSource(dt1);
            //   rd.SetParameterValue(1, Convert.ToDecimal(Request.QueryString["sd"].ToString()));
            //  rd.SetParameterValue(0,Convert.ToInt32(Request.QueryString["d"].ToString()));

            CrptInvoice.ReportSource = rd;
            CrptInvoice.DataBind();
        }
    }
 public void BindInvoice()
 {
     Rptrpending.DataSource = CnFInvoice.GetInvoiceNos(Convert.ToInt32(strFY));
     Rptrpending.DataBind();
 }