Beispiel #1
0
        public static int UnseenOrd(int OrgId)
        {
            string Query = "SELECT distinct TickedNo,OID FROM HG_OrderItem WHERE  (Status=1 or Status=2) and OID In(select OID from HG_Orders where  Status='1' ";
            int    Count = 0;
            HG_OrganizationDetails ObjOrg = new HG_OrganizationDetails().GetOne(OrgId);

            if (OrgId == 0 || (ObjOrg.OrgID > 0 && ObjOrg.PaymentType == 1))
            {
                Query = "SELECT distinct TickedNo,OID FROM HG_OrderItem WHERE  (Status=1 or Status=2) and OID In(select OID from HG_Orders where  Status='1' and PaymentStatus!= 0 ";
            }
            if (OrgId > 0)
            {
                Query += "and OrgId=" + OrgId.ToString() + " )";
            }
            else
            {
                Query += ")";
            }

            System.Data.SqlClient.SqlCommand    cmd = null;
            System.Data.SqlClient.SqlDataReader SDR = null;
            HG_OrderItem ObjTmp = new HG_OrderItem();
            DBCon        Obj    = new DBCon();

            try
            {
                cmd = new System.Data.SqlClient.SqlCommand(Query, Obj.Con);
                SDR = cmd.ExecuteReader();
                while (SDR.Read())
                {
                    Count = Count + 1;
                }
            }
            catch (System.Exception e) { e.ToString(); }
            finally { cmd.Dispose(); SDR.Close(); Obj.Con.Close(); Obj.Con.Dispose(); Obj.Con = null; }
            return(Count);
        }
Beispiel #2
0
        public HG_OrganizationDetails GetOne(int OrgID)
        {
            SqlConnection Con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["Con"].ToString());

            Con.Open();
            SqlCommand             cmd    = null;
            SqlDataReader          SDR    = null;
            HG_OrganizationDetails ObjTmp = new HG_OrganizationDetails();

            try
            {
                string Query = "SELECT * FROM  HG_OrganizationDetails where OrgID =@OrgID ";
                cmd = new SqlCommand(Query, Con);
                cmd.Parameters.AddWithValue("@OrgID ", OrgID);
                SDR = cmd.ExecuteReader();
                while (SDR.Read())
                {
                    ObjTmp.OrgID            = SDR.GetInt32(0);
                    ObjTmp.OrgTypes         = SDR.GetString(1);
                    ObjTmp.HeadName         = SDR.GetString(2);
                    ObjTmp.Name             = SDR.GetString(3);
                    ObjTmp.Address          = SDR.GetString(4);
                    ObjTmp.City             = SDR.GetString(5);
                    ObjTmp.State            = SDR.GetString(6);
                    ObjTmp.PinCode          = SDR.GetString(7);
                    ObjTmp.Phone            = SDR.GetString(8);
                    ObjTmp.Cell             = SDR.GetString(9);
                    ObjTmp.Email            = SDR.GetString(10);
                    ObjTmp.WebSite          = SDR.GetString(11);
                    ObjTmp.Logo             = SDR.GetString(12);
                    ObjTmp.GSTNO            = SDR.GetString(15);
                    ObjTmp.PANNO            = SDR.GetString(16);
                    ObjTmp.BankName         = SDR.GetString(17);
                    ObjTmp.ACNO             = SDR.GetString(18);
                    ObjTmp.AcType           = SDR.GetString(19);
                    ObjTmp.Status           = SDR.GetBoolean(23);
                    ObjTmp.PaymentType      = SDR.IsDBNull(24) ? 1 : SDR.GetInt32(24);
                    ObjTmp.IvoiceHeading    = SDR.IsDBNull(25) ? " " : SDR.GetString(25);
                    ObjTmp.AddressLin2      = SDR.IsDBNull(26) ? " " : SDR.GetString(26);
                    ObjTmp.AddressLine3     = SDR.IsDBNull(27) ? " " : SDR.GetString(27);
                    ObjTmp.Licence2         = SDR.IsDBNull(28) ? " " : SDR.GetString(28);
                    ObjTmp.License3         = SDR.IsDBNull(29) ? " " : SDR.GetString(29);
                    ObjTmp.PrintRemark      = SDR.GetString(30);
                    ObjTmp.CustomerOrdering = SDR.GetBoolean(31);
                    ObjTmp.InvoiceTitle     = SDR.GetString(32);
                    ObjTmp.invoicePhone     = SDR.GetString(33);
                    ObjTmp.DistrictId       = SDR.GetInt32(34);
                    ObjTmp.InvoicePrintting = SDR.GetInt32(35);
                    ObjTmp.NuOfCopy         = SDR.GetInt32(36);
                    ObjTmp.OrderDisplay     = SDR.GetInt32(37);
                    ObjTmp.PrinttingType    = SDR.GetInt32(38);
                    ObjTmp.Copy             = SDR.GetInt32(39);
                    ObjTmp.WalletAmt        = SDR.GetDouble(40);
                }
            }
            catch (Exception e)
            { e.ToString(); }

            finally { Con.Close(); }

            return(ObjTmp);
        }
Beispiel #3
0
        public List <HG_OrganizationDetails> GetAll(int Orgid = 0)
        {
            var           CurrOrgID = HttpContext.Current.Request.Cookies["UserInfo"];
            SqlConnection Con       = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["Con"].ToString());

            Con.Open();
            SqlCommand    cmd = null;
            SqlDataReader SDR = null;
            List <HG_OrganizationDetails> ListTmp = new List <HG_OrganizationDetails>();
            string Query = "SELECT * FROM  HG_OrganizationDetails ORDER BY OrgID  DESC";

            if (OrgID > 0)
            {
                Query = "SELECT * FROM  HG_OrganizationDetails where OrgID=" + OrgID.ToString() + "  ORDER BY OrgID  DESC";
            }
            else if (CurrOrgID != null && int.Parse(CurrOrgID["OrgId"]) > 0)
            {
                Query = "SELECT * FROM  HG_OrganizationDetails where OrgID=" + CurrOrgID["OrgId"] + "  ORDER BY OrgID  DESC";
            }
            try
            {
                cmd = new SqlCommand(Query, Con);
                SDR = cmd.ExecuteReader();
                while (SDR.Read())
                {
                    HG_OrganizationDetails ObjTmp = new HG_OrganizationDetails();
                    ObjTmp.OrgID            = SDR.GetInt32(0);
                    ObjTmp.OrgTypes         = SDR.GetString(1);
                    ObjTmp.HeadName         = SDR.GetString(2);
                    ObjTmp.Name             = SDR.GetString(3);
                    ObjTmp.Address          = SDR.GetString(4);
                    ObjTmp.City             = SDR.GetString(5);
                    ObjTmp.State            = SDR.GetString(6);
                    ObjTmp.PinCode          = SDR.GetString(7);
                    ObjTmp.Phone            = SDR.GetString(8);
                    ObjTmp.Cell             = SDR.GetString(9);
                    ObjTmp.Email            = SDR.GetString(10);
                    ObjTmp.WebSite          = SDR.GetString(11);
                    ObjTmp.Logo             = SDR.GetString(12);
                    ObjTmp.GSTNO            = SDR.GetString(15);
                    ObjTmp.PANNO            = SDR.GetString(16);
                    ObjTmp.BankName         = SDR.GetString(17);
                    ObjTmp.ACNO             = SDR.GetString(18);
                    ObjTmp.AcType           = SDR.GetString(19);
                    ObjTmp.Status           = SDR.GetBoolean(23);
                    ObjTmp.PaymentType      = SDR.IsDBNull(24)?1: SDR.GetInt32(24);
                    ObjTmp.IvoiceHeading    = SDR.IsDBNull(25) ? "  " : SDR.GetString(25);
                    ObjTmp.AddressLin2      = SDR.IsDBNull(26) ? "  " : SDR.GetString(26);
                    ObjTmp.AddressLine3     = SDR.IsDBNull(27) ? "  " : SDR.GetString(27);
                    ObjTmp.Licence2         = SDR.IsDBNull(28) ? "  " : SDR.GetString(28);
                    ObjTmp.License3         = SDR.IsDBNull(29) ? "  " : SDR.GetString(29);
                    ObjTmp.PrintRemark      = SDR.GetString(30);
                    ObjTmp.CustomerOrdering = SDR.GetBoolean(31);
                    ObjTmp.InvoiceTitle     = SDR.GetString(32);
                    ObjTmp.invoicePhone     = SDR.GetString(33);
                    ObjTmp.DistrictId       = SDR.GetInt32(34);
                    ObjTmp.InvoicePrintting = SDR.GetInt32(35);
                    ObjTmp.NuOfCopy         = SDR.GetInt32(36);
                    ObjTmp.OrderDisplay     = SDR.GetInt32(37);
                    ObjTmp.PrinttingType    = SDR.GetInt32(38);
                    ObjTmp.Copy             = SDR.GetInt32(39);
                    ObjTmp.WalletAmt        = SDR.GetDouble(40);
                    ListTmp.Add(ObjTmp);
                }
            }
            catch (System.Exception e) { e.ToString(); }
            finally { Con.Close(); }

            return(ListTmp);
        }