Example #1
0
        public List <customer> customerdetails(string DeliverTime, string restcode)
        {
            try
            {
                GetConnectionString getConnectionString = new GetConnectionString();
                string        ConnectionString          = getConnectionString.CustomizeConnectionString(restcode);
                SqlConnection Conn = new SqlConnection(ConnectionString);
                Conn.Open();

                List <customer> customerdetails = new List <customer>();
                if (Conn.State != System.Data.ConnectionState.Open)
                {
                    Conn.Open();
                }

                SqlCommand cmd = new SqlCommand("searchBycustPhoneAndName", Conn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@customerdata", DeliverTime);
                SqlDataReader _Reader = cmd.ExecuteReader();

                while (_Reader.Read())
                {
                    customer objCust = new customer();
                    objCust.phoneNo   = _Reader["CustPhoneNumber"].ToString();
                    objCust.firstname = _Reader["CustomerFName"].ToString();
                    objCust.lastname  = _Reader["CustomerLName"].ToString();
                    objCust.daddress  = _Reader["Delivery_Addresss"].ToString();
                    objCust.laddress  = _Reader["Land_mark"].ToString();
                    objCust.Deliverylocationlatitude  = _Reader["Deliverylocationlatitude"].ToString();
                    objCust.Deliverylocationlongitude = _Reader["Deliverylocationlongitude"].ToString();
                    objCust.ModifiedDate = _Reader["ModifiedDate"].ToString();
                    objCust.CreatedDate  = _Reader["CreatedDate"].ToString();
                    objCust.mobileno2    = _Reader["Mobile2"].ToString();
                    objCust.mobileno1    = _Reader["Mobile1"].ToString();
                    // objCust.custTypeId = _Reader["CustomerTypeId"].ToString();
                    customerdetails.Add(objCust);
                }

                return(customerdetails);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                //if (Conn != null)
                //{
                //    //if (Conn.State == ConnectionState.Open)
                //    //{
                //    //    Conn.Close();
                //    //    Conn.Dispose();
                //    //}
                //}
            }
        }
Example #2
0
        public List <chartline> chartline(string DeliverTime, string restcode)
        {
            try
            {
                GetConnectionString getConnectionString = new GetConnectionString();
                string        ConnectionString          = getConnectionString.CustomizeConnectionString(restcode);
                SqlConnection Conn = new SqlConnection(ConnectionString);

                Conn.Open();
                DateTime DeliverTime1 = Convert.ToDateTime(DeliverTime);



                List <chartline> _chartlines = new List <chartline>();


                if (Conn.State != System.Data.ConnectionState.Open)
                {
                    Conn.Open();
                }

                SqlCommand cmd = new SqlCommand("spchartline", Conn);
                cmd.Parameters.AddWithValue("@from_date", DeliverTime1);
                cmd.CommandType = CommandType.StoredProcedure;
                SqlDataReader _Reader = cmd.ExecuteReader();

                while (_Reader.Read())
                {
                    chartline chartl = new chartline();
                    //    chartl.OrderDate = DateTime.ParseExact((_Reader["OrderDate"].ToString()), "ddd MMM dd yyyy HH:mm:ss", CultureInfo.InvariantCulture);
                    chartl.OrderDate = Convert.ToDateTime((_Reader["OrderDate"].ToString()));

                    chartl.Orders = _Reader[""].ToString();
                    _chartlines.Add(chartl);
                }

                return(_chartlines);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                //if (Conn != null)
                //{
                //    if (Conn.State == ConnectionState.Open)
                //    {
                //        Conn.Close();
                //        Conn.Dispose();
                //    }
                //}
            }
        }
Example #3
0
        public List <reports> custreports(string phoneno, string restcode)
        {
            try
            {
                GetConnectionString getConnectionString = new GetConnectionString();
                string        ConnectionString          = getConnectionString.CustomizeConnectionString(restcode);
                SqlConnection Conn = new SqlConnection(ConnectionString);

                Conn.Open();

                List <reports> custreports = new List <reports>();
                if (Conn.State != System.Data.ConnectionState.Open)
                {
                    Conn.Open();
                }
                SqlCommand cmd = new SqlCommand("spviewcustordersforreport", Conn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@custphone", phoneno);
                SqlDataReader _Reader = cmd.ExecuteReader();

                while (_Reader.Read())
                {
                    reports objCust = new reports();
                    objCust.OrderId    = _Reader["OrderId"].ToString();
                    objCust.OrderDate  = _Reader["OrderDate"].ToString();
                    objCust.restcode   = _Reader["restcode"].ToString();
                    objCust.OrderType  = _Reader["OrderType"].ToString();
                    objCust.amountPaid = _Reader["AmountPaid"].ToString();
                    objCust.TotalPrice = _Reader["TotalAmount"].ToString();
                    objCust.OrderType  = _Reader["OrderType"].ToString();


                    custreports.Add(objCust);
                }

                return(custreports);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                //if (Conn != null)
                //{
                //    //if (Conn.State == ConnectionState.Open)
                //    //{
                //    //    Conn.Close();
                //    //    Conn.Dispose();
                //    //}
                //}
            }
        }
Example #4
0
        public List <chartbar> chartbar(string DeliverTime, string restcode)
        {
            try
            {
                GetConnectionString getConnectionString = new GetConnectionString();
                string        ConnectionString          = getConnectionString.CustomizeConnectionString(restcode);
                SqlConnection Conn = new SqlConnection(ConnectionString);

                Conn.Open();
                DateTime DeliverTime1 = Convert.ToDateTime(DeliverTime);



                List <chartbar> _chartbars = new List <chartbar>();


                if (Conn.State != System.Data.ConnectionState.Open)
                {
                    Conn.Open();
                }

                SqlCommand cmd = new SqlCommand("spchartbar", Conn);
                cmd.Parameters.AddWithValue("@from_date", DeliverTime1);
                cmd.CommandType = CommandType.StoredProcedure;
                SqlDataReader _Reader = cmd.ExecuteReader();

                while (_Reader.Read())
                {
                    chartbar chartbar = new chartbar();
                    chartbar.count = _Reader["count"].ToString();
                    chartbar.month = _Reader["month"].ToString();
                    _chartbars.Add(chartbar);
                }

                return(_chartbars);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                //if (Conn != null)
                //{
                //    if (Conn.State == ConnectionState.Open)
                //    {
                //        Conn.Close();
                //        Conn.Dispose();
                //    }
                //}
            }
        }
Example #5
0
        public List <orderdetails> orderdetails(string orderdetails, string restcode)
        {
            try
            {
                GetConnectionString getConnectionString = new GetConnectionString();
                string        ConnectionString          = getConnectionString.CustomizeConnectionString(restcode);
                SqlConnection Conn = new SqlConnection(ConnectionString);

                Conn.Open();

                List <orderdetails> ordetails = new List <orderdetails>();
                if (Conn.State != System.Data.ConnectionState.Open)
                {
                    Conn.Open();
                }
                SqlCommand cmd = new SqlCommand("sploadcartforconformpage", Conn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@Orderid", orderdetails);
                SqlDataReader _Reader = cmd.ExecuteReader();

                while (_Reader.Read())
                {
                    orderdetails objCust = new orderdetails();
                    objCust.Price       = Convert.ToInt16(_Reader["price"]);
                    objCust.Quantity    = Convert.ToInt16(_Reader["Quantity"]);
                    objCust.ProductName = _Reader["ProductName"].ToString();
                    //objCust.Image = _Reader["Image"];
                    ordetails.Add(objCust);
                }

                return(ordetails);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            //finally
            //{
            //    //if (Conn != null)
            //    //{
            //    //    //if (Conn.State == ConnectionState.Open)
            //    //    //{
            //    //    //    Conn.Close();
            //    //    //    Conn.Dispose();
            //    //    //}
            //    //}
            //}
            //}
        }
Example #6
0
        public List <discount> custdiscounts(string phoneno, string restcode)
        {
            try
            {
                GetConnectionString getConnectionString = new GetConnectionString();
                string        ConnectionString          = getConnectionString.CustomizeConnectionString(restcode);
                SqlConnection Conn = new SqlConnection(ConnectionString);

                Conn.Open();

                List <discount> custdiscount = new List <discount>();
                if (Conn.State != System.Data.ConnectionState.Open)
                {
                    Conn.Open();
                }
                SqlCommand cmd = new SqlCommand("spviewcustdicount", Conn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@custphone", phoneno);
                SqlDataReader _Reader = cmd.ExecuteReader();

                while (_Reader.Read())
                {
                    discount objCust = new discount();
                    objCust.Phoneno  = _Reader["CustPhoneNumber"].ToString();
                    objCust.Discount = _Reader["Discount"].ToString();


                    custdiscount.Add(objCust);
                }

                return(custdiscount);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                //if (Conn != null)
                //{
                //    //if (Conn.State == ConnectionState.Open)
                //    //{
                //    //    Conn.Close();
                //    //    Conn.Dispose();
                //    //}
                //}
            }
        }
Example #7
0
        public List <reports> Weeklyreports(DateTime DeliverTime, string restcode)
        {
            try
            {
                GetConnectionString getConnectionString = new GetConnectionString();
                string        ConnectionString          = getConnectionString.CustomizeConnectionString(restcode);
                SqlConnection Conn = new SqlConnection(ConnectionString);


                Conn.Open();
                DateTime DeliverTime1 = Convert.ToDateTime(DeliverTime);

                List <reports> Monthlyreports = new List <reports>();
                if (Conn.State != System.Data.ConnectionState.Open)
                {
                    Conn.Open();
                }
                SqlCommand cmd = new SqlCommand("rptGetWeeklyReportDT", Conn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@from_date", DeliverTime1);
                SqlDataReader _Reader = cmd.ExecuteReader();

                while (_Reader.Read())
                {
                    reports objCust = new reports();
                    objCust.OrderId           = _Reader["OrderId"].ToString();
                    objCust.OrderDate         = _Reader["OrderDate"].ToString();
                    objCust.restcode          = _Reader["restcode"].ToString();
                    objCust.amountPaid        = _Reader["amountPaid"].ToString();
                    objCust.statusdiscription = _Reader["statusdiscription"].ToString();
                    objCust.customerphone     = _Reader["customerphone"].ToString();
                    objCust.customerfname     = _Reader["customerfname"].ToString();
                    objCust.customerlname     = _Reader["customerlname"].ToString();
                    objCust.Quantity          = _Reader["Quantity"].ToString();
                    objCust.TotalPrice        = _Reader["TotalPrice"].ToString();
                    objCust.Deliverycharges   = _Reader["Deliverycharges"].ToString();
                    objCust.cgstcharges       = _Reader["cgstcharges"].ToString();
                    objCust.sgstcharges       = _Reader["sgstcharges"].ToString();
                    objCust.Discount          = _Reader["Discount"].ToString();
                    objCust.Tip               = _Reader["Tip"].ToString();
                    objCust.Remarks           = _Reader["Remarks"].ToString();
                    objCust.OrderType         = _Reader["OrderType"].ToString();
                    objCust.TransactionId     = _Reader["TransactionId"].ToString();
                    objCust.status            = _Reader["statusid"].ToString();
                    objCust.Orderstatus       = _Reader["statusdiscription"].ToString();
                    objCust.Delivery_Addresss = _Reader["Delivery_Addresss"].ToString();
                    objCust.empcode           = _Reader["empcode"].ToString();
                    objCust.TotalPrice        = _Reader["TotalPrice"].ToString();
                    objCust.Billing_Address   = _Reader["Billing_Address"].ToString();
                    objCust.TransactionStatus = _Reader["TransactionStatus"].ToString();
                    Monthlyreports.Add(objCust);
                }

                return(Monthlyreports);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            //finally
            //{
            //    if (Conn != null)
            //    {
            //        //if (Conn.State == ConnectionState.Open)
            //        //{
            //        //    Conn.Close();
            //        //    Conn.Dispose();
            //        //}
            //    }
            //}
        }