Beispiel #1
0
        //Get List Of Sales Voucher Details In List
        public List <TransListModel> GetAllSalesVoucherMaster()
        {
            List <TransListModel> lstModel = new List <TransListModel>();
            TransListModel        objList;
            StringBuilder         sbQuery = new StringBuilder();

            sbQuery.AppendLine("SELECT m.SalesVoucher_Id, i.Id,m.SaleDate,m.VoucherNumber, i.ITM_ID, i.Qty, i.Unit,i.Amount,im.ITEM_Name,am.ACC_NAME FROM salesvoucher_master AS m");
            sbQuery.AppendLine("INNER JOIN salesvoucher_itemdetails AS i ON m.SalesVoucher_Id=i.SalesVoucher_Id");
            sbQuery.AppendLine("left join itemmaster as im ON i.itm_id=im.ITM_ID");
            sbQuery.AppendLine("left join accountmaster am ON am.Ac_ID = m.LedgerId;");

            System.Data.IDataReader dr = _dbHelper.ExecuteDataReader(sbQuery.ToString(), _dbHelper.GetConnObject());

            while (dr.Read())
            {
                objList = new TransListModel();

                objList.trans_sales_id = Convert.ToInt32(dr["SalesVoucher_Id"]);
                objList.item_id        = Convert.ToInt32(dr["Id"]);
                objList.saledate       = Convert.ToDateTime(dr["SaleDate"]);
                objList.voucherno      = Convert.ToInt32(dr["VoucherNumber"]);
                objList.party          = Convert.ToString(dr["ACC_NAME"]);
                objList.item           = Convert.ToString(dr["ITEM_Name"].ToString() == null?string.Empty: dr["ITEM_Name"].ToString());
                objList.qty            = Convert.ToInt32(dr["Qty"]);
                objList.unit           = Convert.ToString(dr["Unit"]);
                objList.amount         = Convert.ToDecimal(dr["Amount"]);
                lstModel.Add(objList);
            }
            return(lstModel);
        }
Beispiel #2
0
        public List <TransListModel> GetAllUnassemble()
        {
            List <TransListModel> lstModel = new List <TransListModel>();
            TransListModel        objList;

            StringBuilder sbQuery = new StringBuilder();

            sbQuery.Append("SELECT t.Unassemble_id, i.itemid, t.UA_date, t.series, t.voucherno,i.item,i.qty,i.unit,i.price,i.amount,i.totalqty, i.totalamount FROM trans_Unassemble_Voucher AS t ");
            sbQuery.Append("INNER JOIN trans_Unassemble_items AS i ON t.Unassemble_Id=i.Unassemble_Id;");


            System.Data.IDataReader dr = _dbHelper.ExecuteDataReader(sbQuery.ToString(), _dbHelper.GetConnObject());

            while (dr.Read())
            {
                objList = new TransListModel();

                objList.trans_sales_id = Convert.ToInt32(dr["Unassemble_Id"]);

                objList.item_id     = Convert.ToInt32(dr["itemid"]);
                objList.saledate    = Convert.ToDateTime(dr["UA_Date"]);
                objList.series      = Convert.ToString(dr["series"]);
                objList.voucherno   = Convert.ToInt32(dr["VoucherNo"]);
                objList.item        = Convert.ToString(dr["item"]);
                objList.qty         = Convert.ToInt32(dr["qty"]);
                objList.unit        = Convert.ToString(dr["unit"]);
                objList.price       = Convert.ToInt32(dr["price"]);
                objList.amount      = Convert.ToInt32(dr["amount"]);
                objList.totalqty    = Convert.ToInt32((dr["totalqty"]));
                objList.totalamount = Convert.ToInt32((dr["totalamount"]));
                lstModel.Add(objList);
            }
            return(lstModel);
        }
Beispiel #3
0
        //Get List Of Purchase Vouchers Details In List
        public List <TransListModel> GetAllPurchaseVoucherMaster()
        {
            List <TransListModel> lstModel = new List <TransListModel>();
            TransListModel        objList;

            StringBuilder sbQuery = new StringBuilder();

            sbQuery.AppendLine("SELECT m.PurcVoucher_Id, i.Id,m.PurcDate,m.VoucherNumber, i.ITM_ID, i.Qty, i.Unit,im.ITEM_Name,am.ACC_NAME FROM purchasevoucher_master AS m");
            sbQuery.AppendLine("INNER JOIN purchasevoucher_itemdetails AS i ON m.PurcVoucher_Id=i.PurcVoucher_Id");
            sbQuery.AppendLine("left join itemmaster as im ON i.itm_id=im.ITM_ID");
            sbQuery.AppendLine("left join accountmaster am ON am.Ac_ID = m.LedgerId;");

            System.Data.IDataReader dr = _dbHelper.ExecuteDataReader(sbQuery.ToString(), _dbHelper.GetConnObject());

            while (dr.Read())
            {
                objList = new TransListModel();

                objList.PurcVchId = Convert.ToInt64(dr["PurcVoucher_Id"]);
                //objList.item_id = Convert.ToInt32(dr["ItemId"]);
                objList.Purcdate  = Convert.ToDateTime(dr["PurcDate"]);
                objList.voucherno = Convert.ToInt32(dr["VoucherNumber"]);
                objList.party     = Convert.ToString(dr["ACC_NAME"]);
                objList.item      = Convert.ToString(dr["ITEM_Name"]);
                objList.qty       = Convert.ToInt32(dr["Qty"]);
                objList.unit      = Convert.ToString(dr["Unit"]);
                lstModel.Add(objList);
            }
            return(lstModel);
        }