コード例 #1
0
 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;
     }
 }
コード例 #2
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;
            }
        }
コード例 #3
0
        protected void ddlTablet_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                List <EntityPrescriptionDetails> lst = null;
                if (ddlTablet.SelectedIndex > 0)
                {
                    IssueMaterialBLL mobjDeptBLL = new IssueMaterialBLL();
                    EntityProduct    entProduct  = mobjDeptBLL.GetProductPrice(Convert.ToInt32(ddlTablet.SelectedValue));

                    List <tblStockDetail> lst1 = new CustomerTransactionBLL().GetProductTransByProductId(Convert.ToInt32(ddlTablet.SelectedValue));
                    if (lst1 != null)
                    {
                        lblBalQty.Text = Convert.ToString(Convert.ToInt32(lst1.Sum(p => p.InwardQty)) - Convert.ToInt32(lst1.Sum(p => p.OutwardQty)));
                    }
                    else
                    {
                        lblBalQty.Text = string.Empty;
                    }
                }
                else
                {
                    lst = new List <EntityPrescriptionDetails>();
                }
            }
            catch (Exception ex)
            {
                lblMsg.Text = ex.Message;
            }
        }
コード例 #4
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;
            }
        }
コード例 #5
0
 protected void ddlPatient_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (ddlPatient.SelectedIndex > 0)
         {
             List <tblCustomerTransaction> lst = new CustomerTransactionBLL().GetPatientTransByPatientAdmitId(Convert.ToInt32(ddlPatient.SelectedValue));
             decimal DR = Convert.ToDecimal(lst.Sum(p => p.BillAmount));
             decimal CR = Convert.ToDecimal(lst.Sum(p => p.PayAmount)) + Convert.ToDecimal(lst.Sum(p => p.AdvanceAmount));
             if (CR > DR)
             {
                 txtTotal.Text = Convert.ToString(CR - DR);
             }
             else
             {
                 txtTotal.Text = Convert.ToString(DR - CR);
             }
         }
     }
     catch (Exception ex)
     {
         lblMsg.Text = ex.Message;
     }
 }
コード例 #6
0
 protected void ddlProduct_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddlProduct.SelectedIndex > 0)
     {
         Session["Prod_ID"] = ddlProduct.SelectedIndex;
         EntityProduct entProduct = mobjDeptBLL.GetProductPrice(Convert.ToInt32(Session["Prod_ID"]));
         txtItemCharge.Text = Convert.ToString(entProduct.Price);
         txtQuantity.Text   = Convert.ToString(1);
         List <tblStockDetail> lst1 = new CustomerTransactionBLL().GetProductTransByProductId(Convert.ToInt32(ddlProduct.SelectedValue));
         if (lst1 != null)
         {
             lblBalQty.Text = Convert.ToString(Convert.ToInt32(lst1.Sum(p => p.InwardQty)) - Convert.ToInt32(lst1.Sum(p => p.OutwardQty)));
         }
         else
         {
             lblBalQty.Text = string.Empty;
         }
     }
 }