Beispiel #1
0
        public List <clsSOCreation> RetrieveCreditTerm()
        {
            StringBuilder sQuery = new StringBuilder();

            sQuery.Append("SELECT credit_term FROM a_Credit_Term");

            List <clsSOCreation> lData = new List <clsSOCreation>();

            try
            {
                var oreader = execReader(sQuery.ToString());

                while (oreader.Read())
                {
                    clsSOCreation obj = new clsSOCreation();

                    obj.credit_term = oreader["credit_term"].ToString();

                    lData.Add(obj);
                }
            }
            catch (Exception ex)
            {
                //message
            }
            finally
            {
                CloseNewConnection();
            }
            return(lData);
        }
Beispiel #2
0
        public List <clsSOCreation> RetrieveCustomerCodeList(string searchby, string searchname)
        {
            StringBuilder sQuery = new StringBuilder();

            sQuery.Append(@"SELECT idCustomer,Customer_Code,Customer_Name,Company_Name,Address1,Address2,Address3,Address4, 
                AddressShipping1,AddressShipping2,AddressShipping3,AddressShipping4,credit_term FROM a_Customer_Details 
                WHERE Status = 'Active' ");

            if (searchby == "Company Name")
            {
                sQuery.Append("AND Company_Name lIKE '%" + searchname + "%' ");
            }
            else if (searchby == "Customer Code")
            {
                sQuery.Append("AND Customer_Code lIKE '%" + searchname + "%' ");
            }

            sQuery.Append("ORDER BY Customer_Code ASC");

            List <clsSOCreation> lData = new List <clsSOCreation>();

            try
            {
                var oreader = execReader(sQuery.ToString());

                while (oreader.Read())
                {
                    clsSOCreation obj = new clsSOCreation();

                    obj.idCustomer       = oreader["idCustomer"].ToString();
                    obj.Customer_Code    = oreader["Customer_Code"].ToString();
                    obj.Customer_Name    = oreader["Customer_Name"].ToString();
                    obj.Company_Name     = oreader["Company_Name"].ToString();
                    obj.Address1         = oreader["Address1"].ToString();
                    obj.Address2         = oreader["Address2"].ToString();
                    obj.Address3         = oreader["Address3"].ToString();
                    obj.Address4         = oreader["Address4"].ToString();
                    obj.AddressShipping1 = oreader["AddressShipping1"].ToString();
                    obj.AddressShipping2 = oreader["AddressShipping2"].ToString();
                    obj.AddressShipping3 = oreader["AddressShipping3"].ToString();
                    obj.AddressShipping4 = oreader["AddressShipping4"].ToString();
                    obj.credit_term      = oreader["credit_term"].ToString();
                    lData.Add(obj);
                }
            }
            catch (Exception ex)
            {
                //message
            }
            finally
            {
                CloseNewConnection();
            }
            return(lData);
        }
        protected void GetCreditTermToDD()
        {
            clsSOCreation        oSOCreation = new clsSOCreation();
            List <clsSOCreation> lData       = oSOCreation.RetrieveCreditTerm();

            ddCreditTerm.Items.Clear();
            ddCreditTerm.DataSource     = lData;
            ddCreditTerm.DataTextField  = "credit_term";
            ddCreditTerm.DataValueField = "credit_term";

            ddCreditTerm.DataBind();
        }
Beispiel #4
0
        //public List<clsSOCreation> RetrieveCurrency()
        //{
        //    StringBuilder sQuery = new StringBuilder();

        //    sQuery.Append("SELECT Currency_Code,Currency_Name FROM a_Currency_Codes ");

        //    List<clsSOCreation> lData = new List<clsSOCreation>();
        //    try
        //    {
        //        var oreader = execReader(sQuery.ToString());

        //        while (oreader.Read())
        //        {
        //            clsSOCreation obj = new clsSOCreation();

        //            obj.Currency_Code = oreader["Currency_Code"].ToString();
        //            obj.Currency_Name = oreader["Currency_Name"].ToString();

        //            lData.Add(obj);
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        //message
        //    }
        //    finally
        //    {
        //        CloseNewConnection();
        //    }
        //    return lData;
        //}
        //public List<clsSOCreation> RetrievePOHeader()
        //{
        //    StringBuilder sQuery = new StringBuilder();

        //    sQuery.Append("SELECT idPOHeader,PO_Number FROM a_PO_Header");

        //    List<clsSOCreation> lData = new List<clsSOCreation>();
        //    try
        //    {
        //        var oreader = execReader(sQuery.ToString());

        //        while (oreader.Read())
        //        {
        //            clsSOCreation obj = new clsSOCreation();

        //            obj.idPOHeader = oreader["idPOHeader"].ToString();
        //            obj.PO_Number = oreader["PO_Number"].ToString();

        //            lData.Add(obj);
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        //message
        //    }
        //    finally
        //    {
        //        CloseNewConnection();
        //    }
        //    return lData;
        //}
        public List <clsSOCreation> RetrieveItemsByidSOHeader(int idSOHeader)
        {
            StringBuilder sQuery = new StringBuilder();

            sQuery.Append("SELECT b.idSODetail,b.idItem,c.Item_Number,c.Description,b.Qty,b.Cost,b.UM, ");
            sQuery.Append("b.Discount,b.Tax_Amount,b.Amount,b.Item_Status FROM a_SO_Header a ");
            sQuery.Append("INNER JOIN a_SO_Detail b ON a.idSOHeader = b.idSOHeader ");
            sQuery.Append("INNER JOIN a_Item_Master c ON b.idItem = c.idItem ");
            sQuery.Append("INNER JOIN a_Item_Class d ON c.idClass = d.idClass ");
            sQuery.Append("WHERE a.idSOHeader ='" + idSOHeader + "'");

            List <clsSOCreation> lData = new List <clsSOCreation>();

            try
            {
                var oreader = execReader(sQuery.ToString());

                while (oreader.Read())
                {
                    clsSOCreation obj = new clsSOCreation();

                    obj.idItem      = oreader["idItem"].ToString();
                    obj.Item_Number = oreader["Item_Number"].ToString();
                    obj.Description = oreader["Description"].ToString();
                    obj.Qty         = oreader["Qty"].ToString();
                    obj.Cost        = double.Parse(oreader["Cost"].ToString()).ToString("n", CultureInfo.GetCultureInfo("en-US"));
                    obj.UM          = oreader["UM"].ToString();
                    obj.Discount    = double.Parse(oreader["Discount"].ToString()).ToString("n", CultureInfo.GetCultureInfo("en-US"));
                    obj.Tax_Amount  = double.Parse(oreader["Tax_Amount"].ToString()).ToString("n", CultureInfo.GetCultureInfo("en-US"));
                    obj.Amount      = double.Parse(oreader["Amount"].ToString()).ToString("n", CultureInfo.GetCultureInfo("en-US"));
                    obj.Item_Status = oreader["Item_Status"].ToString();
                    obj.idSODetail  = oreader["idSODetail"].ToString();

                    lData.Add(obj);
                }
            }
            catch (Exception ex)
            {
                //message
            }
            finally
            {
                CloseNewConnection();
            }
            return(lData);
        }