Exemple #1
0
        public static DataTable GetQuotationList()
        {
            ISession  session     = null;
            IList     objectsList = null;
            DataTable dT_         = new DataTable();
            DataRow   dR_         = null;

            try
            {
                //string queryString = " select tbl_MProQuot.MProQuot_id,DProQuot_id,MProQuot_dat,MProQuot_rmk,tbl_MProQuot.CustomerID, " +
                //    " CustomerName, tbl_DProQuot.ProductID, ProductName, MProQuot_app ,MProQuot_tamt," +
                //    " MProQuot_Rej, tbl_MProQuot.CreatedBy, tbl_MProQuot.CreatedAt, tbl_MProQuot.ISActive " +
                //    " from tbl_MProQuot " +
                //    " inner join tbl_DProQuot on tbl_MProQuot.MProQuot_id = tbl_DProQuot.MProQuot_id and tbl_MProQuot.ISActive = tbl_DProQuot.ISActive " +
                //    " inner join Products on tbl_DProQuot.ProductID = Products.ProductID " +
                //    " inner join Customers_ on tbl_MProQuot.CustomerID = Customers_.CustomerID " +
                //    " where MProQuot_app = 0 and MProQuot_Rej = 0 order by tbl_MProQuot.MProQuot_id desc  ";
                string queryString = " select MProQuot_sono,MProQuot_dat,CustomerName,MProQuot_rmk,  tbl_MProQuot.CreatedBy, tbl_MProQuot.CreatedAt,tbl_MProQuot.MProQuot_id,tbl_MProQuot.CustomerID, " +
                                     "  MProQuot_app, MProQuot_Rej, tbl_MProQuot.ISActive " +
                                     " from tbl_MProQuot " +
                                     " inner join Customers_ on tbl_MProQuot.CustomerID = Customers_.CustomerID " +
                                     " where MProQuot_app = 0 and MProQuot_Rej = 0  and tbl_MProQuot.ISActive = 1  order by tbl_MProQuot.MProQuot_id desc";

                session = NHibernateHelper.GetCurrentSession();
                IQuery iQuery = session.CreateSQLQuery(queryString);
                objectsList = iQuery.List();
                {
                    dT_.Columns.Add("MProQuot_sono");
                    dT_.Columns.Add("MProQuot_dat");
                    dT_.Columns.Add("CustomerName");
                    dT_.Columns.Add("MProQuot_rmk");
                    dT_.Columns.Add("CreatedBy");
                    dT_.Columns.Add("CreatedAt");
                    dT_.Columns.Add("MProQuot_Rej");
                    dT_.Columns.Add("CustomerID");
                    dT_.Columns.Add("MProQuot_app");
                    dT_.Columns.Add("ISActive");
                    dT_.Columns.Add("MProQuot_id");
                }
                foreach (object[] row_ in objectsList)
                {
                    dR_ = dT_.NewRow();
                    dR_["MProQuot_sono"] = row_[0];
                    dR_["MProQuot_dat"]  = row_[1];
                    dR_["CustomerName"]  = row_[2];
                    dR_["MProQuot_rmk"]  = row_[3];
                    dR_["CreatedBy"]     = row_[4];
                    dR_["CreatedAt"]     = row_[5];
                    dR_["MProQuot_Rej"]  = row_[6];
                    dR_["CustomerID"]    = row_[7];
                    dR_["MProQuot_app"]  = row_[8];
                    dR_["ISActive"]      = row_[9];
                    dR_["MProQuot_id"]   = row_[10];

                    dT_.Rows.Add(row_);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (session != null)
                {
                    NHibernateHelper.CloseSession();
                }
            }
            return(dT_);
        }
Exemple #2
0
        public static DataTable GetSupplierList()
        {
            ISession  session     = null;
            IList     objectsList = null;
            DataTable dT_         = new DataTable();
            DataRow   dR_         = null;

            try
            {
                string queryString = " select a.supplierId, a.suppliername, a.contactperson, a.BackUpContact, a.City_, a.phoneno, a.mobile, a.faxno, a.postalcode, a.designation, " +
                                     " a.AddressOne, a.AddressTwo, a.CNIC, a.Url, a.BusinessNature, a.Email, a.NTNNTRNo, a.CreatedBy, convert(date, cast(a.CreatedDate as date) ,105) as [CreatedAt], a.IsActive, a.Sup_Code from supplier a order by a.supplierId desc";

                session = NHibernateHelper.GetCurrentSession();
                IQuery iQuery = session.CreateSQLQuery(queryString);
                objectsList = iQuery.List();
                {
                    dT_.Columns.Add("supplierId");
                    dT_.Columns.Add("suppliername");
                    dT_.Columns.Add("contactperson");
                    dT_.Columns.Add("BackUpContact");
                    dT_.Columns.Add("City_");
                    dT_.Columns.Add("phoneno");
                    dT_.Columns.Add("mobile");
                    dT_.Columns.Add("faxno");
                    dT_.Columns.Add("postalcode");
                    dT_.Columns.Add("designation");
                    dT_.Columns.Add("AddressOne");
                    dT_.Columns.Add("AddressTwo");
                    dT_.Columns.Add("CNIC");
                    dT_.Columns.Add("Url");
                    dT_.Columns.Add("BusinessNature");
                    dT_.Columns.Add("Email");
                    dT_.Columns.Add("NTNNTRNo");
                    dT_.Columns.Add("CreatedBy");
                    dT_.Columns.Add("CreatedDate");
                    dT_.Columns.Add("IsActive");
                    dT_.Columns.Add("Sup_Code");
                }
                foreach (object[] row_ in objectsList)
                {
                    dR_ = dT_.NewRow();
                    dR_["supplierId"]     = row_[0];
                    dR_["suppliername"]   = row_[1];
                    dR_["contactperson"]  = row_[2];
                    dR_["BackUpContact"]  = row_[3];
                    dR_["City_"]          = row_[4];
                    dR_["phoneno"]        = row_[5];
                    dR_["mobile"]         = row_[6];
                    dR_["faxno"]          = row_[7];
                    dR_["postalcode"]     = row_[8];
                    dR_["designation"]    = row_[9];
                    dR_["AddressOne"]     = row_[10];
                    dR_["AddressTwo"]     = row_[11];
                    dR_["CNIC"]           = row_[12];
                    dR_["Url"]            = row_[13];
                    dR_["BusinessNature"] = row_[14];
                    dR_["Email"]          = row_[15];
                    dR_["NTNNTRNo"]       = row_[16];
                    dR_["CreatedBy"]      = row_[17];
                    dR_["CreatedDate"]    = row_[18];
                    dR_["IsActive"]       = row_[19];
                    dR_["Sup_Code"]       = row_[20];
                    dT_.Rows.Add(row_);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (session != null)
                {
                    NHibernateHelper.CloseSession();
                }
            }
            return(dT_);
        }
Exemple #3
0
        public static DataTable GetMPurList()
        {
            ISession  session     = null;
            IList     objectsList = null;
            DataTable dT_         = new DataTable();
            DataRow   dR_         = null;

            try
            {
                //string queryString = " select MPurID, subheadcategoryfivename,VndrAdd,VndrCntct,PurNo,MPurDate,CNIC,NTNNo,MPurchase.CreatedBy,MPurchase.CreatedAt,ToBePrntd from MPurchase " +
                //  " inner join subheadcategoryfive on MPurchase.ven_id = subheadcategoryfive.subheadcategoryfiveID ";

                string queryString = " select MPurID, suppliername,VndrAdd,VndrCntct,PurNo,MPurDate,supplier.CNIC,NTNNo, " +
                                     " MPurchase.CreatedBy,MPurchase.CreatedAt,ToBePrntd from MPurchase  inner join " +
                                     " supplier on MPurchase.ven_id = supplier.supplierId ";

                session = NHibernateHelper.GetCurrentSession();
                IQuery iQuery = session.CreateSQLQuery(queryString);
                objectsList = iQuery.List();
                {
                    dT_.Columns.Add("MPurID");
                    dT_.Columns.Add("suppliername");
                    dT_.Columns.Add("VndrAdd");
                    dT_.Columns.Add("VndrCntct");
                    dT_.Columns.Add("PurNo");
                    dT_.Columns.Add("MPurDate");
                    dT_.Columns.Add("CNIC");
                    dT_.Columns.Add("NTNNo");
                    dT_.Columns.Add("CreatedBy");
                    dT_.Columns.Add("CreatedAt");
                    dT_.Columns.Add("ToBePrntd");
                }
                foreach (object[] row_ in objectsList)
                {
                    dR_                 = dT_.NewRow();
                    dR_["MPurID"]       = row_[0];
                    dR_["suppliername"] = row_[1];
                    dR_["VndrAdd"]      = row_[2];
                    dR_["VndrCntct"]    = row_[3];
                    dR_["PurNo"]        = row_[4];
                    dR_["MPurDate"]     = row_[5];
                    dR_["CNIC"]         = row_[6];
                    dR_["NTNNo"]        = row_[7];
                    dR_["CreatedBy"]    = row_[8];
                    dR_["CreatedAt"]    = row_[9];
                    dR_["ToBePrntd"]    = row_[9];

                    dT_.Rows.Add(row_);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (session != null)
                {
                    NHibernateHelper.CloseSession();
                }
            }
            return(dT_);
        }