예제 #1
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                lbl.Text = "Patient Ledger";
                lblFrom.Text = ddlPatient.SelectedItem.Text;
                lblTo.Text = string.Format("{0:dd-MMM-yyyy}", DateTime.Now);
                lblMessage.Text = string.Empty;

                List<tblCustomerTransaction> lst = new CustomerTransactionBLL().GetPatientTransByPatientId(Convert.ToInt32(ddlPatient.SelectedValue));
                EntityPatientMaster objPatient = new PatientMasterBLL().GetPatientDetailsByPatientId(Convert.ToInt32(ddlPatient.SelectedValue));
                if (objPatient != null)
                {
                    lblAge.Text = Convert.ToString(objPatient.Age);
                    MRN.Text = Convert.ToString(objPatient.PatientCode);
                    lblSex.Text = Convert.ToString(objPatient.GenderDesc);
                    lblBloodGroup.Text = Convert.ToString(objPatient.BloodGroup);
                }
                tblCustomerTransaction obj = new tblCustomerTransaction() { };
                lst.Add(obj);
                tblCustomerTransaction objBills = new tblCustomerTransaction()
                {
                    TransactionType = "Total Invoices Amt",
                    BillAmount = Convert.ToDecimal(lst.Sum(p => p.BillAmount))
                };
                lst.Add(objBills);
                tblCustomerTransaction objReceived = new tblCustomerTransaction()
                {
                    TransactionType = "Total Received",
                    PayAmount = Convert.ToDecimal(lst.Sum(p => p.PayAmount)) + Convert.ToDecimal(lst.Sum(p => p.AdvanceAmount))
                };
                lst.Add(objReceived);

                tblCustomerTransaction objFinal = new tblCustomerTransaction()
                {
                    TransactionType = "Balance(+)/Refund(-) Amt",

                    BillAmount = objBills.BillAmount - objReceived.PayAmount
                };
                lst.Add(objFinal);

                dgvTestParameter.DataSource = lst;
                dgvTestParameter.DataBind();
                Session["PatientLedg"] = ListConverter.ToDataTable(lst);
            }
            catch (Exception ex)
            {
                lblMessage.Text = ex.Message;
            }
        }
예제 #2
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                DateTime Curr = Convert.ToDateTime(DateTime.Now);
                DateTime Next = Curr.AddYears(1);
                lbl.Text = "SUPPLIER LEDGER REPORT" + " " + string.Format("{0:yyyy}", Curr) + "-" + string.Format("{0:yyyy}", Next);

                lblFrom.Text    = ddlSupplier.SelectedItem.Text;
                lblTo.Text      = string.Format("{0:dd-MMM-yyyy}", DateTime.Now);
                lblMessage.Text = string.Empty;
                List <tblCustomerTransaction> lst = new CustomerTransactionBLL().GetSupplierTransBySupplierId(Convert.ToInt32(ddlSupplier.SelectedValue));
                tblCustomerTransaction        obj = new tblCustomerTransaction()
                {
                };
                lst.Add(obj);
                tblCustomerTransaction objReceived = new tblCustomerTransaction()
                {
                    TransactionType = "Total Received",
                    PayAmount       = Convert.ToDecimal(lst.Sum(p => p.PayAmount))
                };
                lst.Add(objReceived);
                tblCustomerTransaction objBills = new tblCustomerTransaction()
                {
                    TransactionType = "Total Bills",
                    BillAmount      = Convert.ToDecimal(lst.Sum(p => p.BillAmount))
                };
                lst.Add(objBills);
                tblCustomerTransaction objFinal = new tblCustomerTransaction()
                {
                    TransactionType = "Total Bills",
                    BillAmount      = objBills.BillAmount - objReceived.PayAmount
                };
                lst.Add(objFinal);
                dgvTestParameter.DataSource = lst;
                dgvTestParameter.DataBind();
                Session["SuppLedg"] = ListConverter.ToDataTable(lst);
            }
            catch (Exception ex)
            {
                lblMessage.Text = ex.Message;
            }
        }
 protected void btnSearch_Click(object sender, EventArgs e)
 {
     try
     {
         lbl.Text        = "STOCK DETAIL REPORT";
         lblFrom.Text    = ddlProduct.SelectedItem.Text;
         lblTo.Text      = string.Format("{0:dd-MMM-yyyy}", DateTime.Now);
         lblMessage.Text = string.Empty;
         EntityProduct entPro = new CustomerTransactionBLL().GetUnitOfMeasurement(ddlProduct.SelectedValue);
         lblUoM.Text = "U.O.M" + "-" + entPro.UOM;
         List <tblStockDetail> lst = new CustomerTransactionBLL().GetProductTransByProductId(Convert.ToInt32(ddlProduct.SelectedValue));
         tblStockDetail        obj = new tblStockDetail()
         {
         };
         lst.Add(obj);
         tblStockDetail objReceived = new tblStockDetail()
         {
             TransactionType = "Total Inward Amount",
             InwardAmount    = Convert.ToDecimal(lst.Sum(p => p.InwardAmount))
         };
         lst.Add(objReceived);
         tblStockDetail objBills = new tblStockDetail()
         {
             TransactionType = "Total Outward Amount",
             OutwardAmount   = Convert.ToDecimal(lst.Sum(p => p.OutwardAmount))
         };
         lst.Add(objBills);
         tblStockDetail objIqty = new tblStockDetail()
         {
             TransactionType = "Total Inward Quntity",
             InwardQty       = Convert.ToInt32(lst.Sum(p => p.InwardQty))
         };
         lst.Add(objIqty);
         tblStockDetail objOqty = new tblStockDetail()
         {
             TransactionType = "Total Outward Quntity",
             OutwardQty      = Convert.ToInt32(lst.Sum(p => p.OutwardQty))
         };
         lst.Add(objOqty);
         tblStockDetail objFinal = new tblStockDetail()
         {
             TransactionType = "Balance Quntity",
             InwardQty       = objIqty.InwardQty - objOqty.OutwardQty
         };
         lst.Add(objFinal);
         dgvTestParameter.DataSource = lst;
         dgvTestParameter.DataBind();
         Session["StockDetailsRep"] = ListConverter.ToDataTable(lst);
     }
     catch (Exception ex)
     {
         lblMessage.Text = ex.Message;
     }
 }