Example #1
0
        public List<XObjs.Office_view> getNew_MarkInfoRSX7(string status, string data_status, string pvalidation, int start, int limit)
        {
            SqlCommand command;
            List<XObjs.Office_view> list = new List<XObjs.Office_view>();
            new XObjs.Office_view();
            SqlConnection connection = new SqlConnection(this.Connect2());

            //  command = new SqlCommand(string.Concat(new object[] { "select   pwallet.rtm,pwallet.ID,pwallet.TransactionId,pwallet.visible,pwallet.applicantID,pwallet.applicantID,applicant.xname,address_service.street ,address_service.telephone1,address_service.email1,mark_info.national_classID 'class',mark_info.xID,mark_info.reg_number 'reg_no',mark_info.product_title,tm_type.type 'tm_type',pwallet.validationID 'oai_no', ISNULL(pwallet.data_status,'None') 'xstat', mark_info.reg_date 'reg_dt',mark_info.log_staff  from mark_info LEFT OUTER JOIN pwallet ON mark_info.log_staff=pwallet.ID   LEFT OUTER JOIN tm_type ON tm_type.xID=mark_info.tm_typeID  LEFT OUTER JOIN applicant ON applicant.log_staff=pwallet.ID LEFT OUTER JOIN address_service ON address_service.log_staff=pwallet.ID    WHERE pwallet.stage='5' AND pwallet.status>='", status, "' AND pwallet.data_status='", data_status, "'  and mark_info.reg_number ='", pvalidation, "' order by pwallet.rtm DESC     " }), connection);

            command = new SqlCommand(string.Concat(new object[] { "select   pwallet.rtm,pwallet.ID,pwallet.TransactionId,pwallet.visible,pwallet.applicantID,pwallet.applicantID,applicant.xname,address.street ,address.telephone1,address.email1,mark_info.national_classID 'class',mark_info.xID,mark_info.reg_number 'reg_no',mark_info.product_title,tm_type.type 'tm_type',pwallet.validationID 'oai_no', ISNULL(pwallet.data_status,'None') 'xstat', mark_info.reg_date 'reg_dt',mark_info.log_staff  from mark_info LEFT OUTER JOIN pwallet ON mark_info.log_staff=pwallet.ID   LEFT OUTER JOIN tm_type ON tm_type.xID=mark_info.tm_typeID  LEFT OUTER JOIN applicant ON applicant.log_staff=pwallet.ID LEFT OUTER JOIN address ON address.ID=applicant.addressID    WHERE pwallet.stage='5' AND pwallet.data_status in ('Certified','Accepted','Opposed','Deferred','Published','kiv','Migrated','New','Registered','Not Opposed', 'Search 2 Conducted', 'Search Conducted')   and mark_info.reg_number ='", pvalidation, "' order by pwallet.rtm DESC     " }), connection);
            //  }
            // command.CommandTimeout = 0;
            connection.Open();
            SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
            string pp2 = "";
            int vcount = 0;
            int vsn = 0;
            string voffice = "";
            while (reader.Read())
            {
                vsn = vsn + 1;
                vcount = vcount + 1;

                XObjs.Registration pdd = getRegistrationBySubagentRegistrationID(reader["applicantID"].ToString());
                //if (getTmOfficeByMID(reader["log_staff"].ToString()) != "")
                //{
                //    voffice = (getTmOfficeByMID(reader["log_staff"].ToString()));
                //}
                //else
                //{
                //    voffice = "None";
                //}
                XObjs.Office_view item = new XObjs.Office_view
                {
                    xid = reader["xID"].ToString(),
                    id = reader["ID"].ToString(),
                    rtm = reader["rtm"].ToString(),
                    applicant_name = reader["xname"].ToString(),
                    xclass = reader["class"].ToString(),
                    reg_no = reader["reg_no"].ToString(),
                    tm_type = reader["tm_type"].ToString(),
                    product_title = reader["product_title"].ToString(),
                    oai_no = reader["oai_no"].ToString(),
                    xstat = reader["xstat"].ToString(),
                    reg_dt = reader["reg_dt"].ToString(),
                    log_staff = reader["log_staff"].ToString(),
                    //   batches = reader["visible"].ToString(),
                    applicantID = reader["applicantID"].ToString(),

                    //Office = reader["data_status"].ToString(),
                    Sn = Convert.ToString(vsn),
                    Agent_Code = pdd.Sys_ID,
                    Agent_Name = pdd.Surname,
                    TransactionId = reader["TransactionId"].ToString(),
                    Xaddress = reader["street"].ToString(),
                    Xemail = reader["email1"].ToString(),
                    Xmobile = reader["telephone1"].ToString()
                };

                try
                {
                    int dw = Convert.ToInt32(reader["visible"]);
                    if (dw > 1)
                    {
                        pp2 = (Convert.ToInt32(reader["visible"]) - 1).ToString();

                    }

                    else
                    {
                        pp2 = (Convert.ToInt32(reader["visible"])).ToString();

                    }
                }
                catch (Exception ee)
                {

                }

                item.batches = pp2;
                list.Add(item);

            }
            reader.Close();
            connection.Close();
            return list;
        }
Example #2
0
        public List<XObjs.Office_view> getNew_MarkInfoRSX4(string pvalidation)
        {
            SqlCommand command;
            List<XObjs.Office_view> list = new List<XObjs.Office_view>();
            new XObjs.Office_view();
            SqlConnection connection = new SqlConnection(this.Connect2());

            command = new SqlCommand(string.Concat(new object[] { "select g_tm_info.tm_title 'tm_title',g_pwallet.ID,g_tm_info.tm_class 'xclass',g_applicant_info.xname,g_applicant_info.address,g_applicant_info.xemail,g_applicant_info.xmobile, g_pwallet.log_officer,g_pwallet.validationID ,g_pwallet.applicantID,g_pwallet.TransactionId,g_tm_info.reg_number,g_tm_info.xID,g_app_info.rtm_number,g_app_info.application_no,g_app_info.item_code,g_app_info.filing_date,g_app_info.reg_no, g_app_info.reg_date,g_app_info.log_staff,g_app_info.visible,g_applicant_info.xname from g_app_info   LEFT OUTER JOIN g_tm_info ON g_app_info.log_staff=g_tm_info.log_staff   LEFT OUTER JOIN g_pwallet ON g_app_info.log_staff=g_pwallet.ID LEFT OUTER JOIN g_applicant_info on  g_pwallet.id=g_applicant_info.log_staff  WHERE  g_app_info.rtm_number ='", pvalidation, "'   " }), connection); ;
            // g_app_info.reg_date,g_app_info.log_staff,g_app_info.visible from g_app_info   LEFT OUTER JOIN g_tm_info ON g_app_info.log_staff=g_tm_info.log_staff

            //  }

            // command.CommandTimeout = 0;
            connection.Open();
            SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
            string pp2 = "";
            int vcount = 0;
            int vsn = 0;
            string voffice = "";
            while (reader.Read())
            {
                vsn = vsn + 1;
                vcount = vcount + 1;

                XObjs.Registration pdd = getRegistrationBySubagentRegistrationID(reader["applicantID"].ToString());
                //if (getTmOfficeByMID(reader["log_staff"].ToString()) != "")
                //{
                //    voffice = (getTmOfficeByMID(reader["log_staff"].ToString()));
                //}
                //else
                //{
                //    voffice = "None";
                //}
                XObjs.Office_view item = new XObjs.Office_view
                {
                    xid = reader["xID"].ToString(),
                    rtm = reader["rtm_number"].ToString(),
                    applicant_name = reader["xname"].ToString(),
                    Xaddress = reader["address"].ToString(),
                    Xemail = reader["xemail"].ToString(),
                    Xmobile = reader["xmobile"].ToString(),
                    xclass = reader["xclass"].ToString(),
                    reg_no = reader["application_no"].ToString(),
                   // tm_type = reader["tm_type"].ToString(),
                    product_title = reader["tm_title"].ToString(),
                    oai_no = reader["validationID"].ToString(),
                  //  xstat = reader["xstat"].ToString(),
                    reg_dt = reader["reg_date"].ToString(),
                    log_staff = reader["log_staff"].ToString(),
                    //   batches = reader["visible"].ToString(),
                    applicantID = reader["applicantID"].ToString(),

                    //Office = reader["data_status"].ToString(),
                    Sn = Convert.ToString(vsn),
                    Agent_Code = pdd.Sys_ID,
                    Agent_Name = pdd.Surname,
                   TransactionId = reader["TransactionId"].ToString(),
                    id = reader["ID"].ToString()
                };

                try
                {
                    int dw = Convert.ToInt32(reader["visible"]);
                    if (dw > 1)
                    {
                        pp2 = (Convert.ToInt32(reader["visible"]) - 1).ToString();

                    }

                    else
                    {
                        pp2 = (Convert.ToInt32(reader["visible"])).ToString();

                    }
                }
                catch (Exception ee)
                {

                }

                item.batches = pp2;
                list.Add(item);

            }
            reader.Close();
            connection.Close();
            return list;
        }
Example #3
0
        public List<XObjs.Office_view> getNew_MarkInfoRSX5(string pvalidation)
        {
            SqlCommand command;
            List<XObjs.Office_view> list = new List<XObjs.Office_view>();
            new XObjs.Office_view();
            SqlConnection connection = new SqlConnection(this.Connect2());
            //if ((status == "4") && (data_status == "Refused"))
            //{
            //    command = new SqlCommand(string.Concat(new object[] { "WITH RSTbl AS (select  pwallet.rtm,pwallet.visible,pwallet.applicantID,applicant.xname,mark_info.national_classID 'class',mark_info.xID,mark_info.reg_number 'reg_no',mark_info.product_title,tm_type.type 'tm_type',pwallet.validationID 'oai_no', ISNULL(pwallet.data_status,'None') 'xstat', mark_info.reg_date 'reg_dt',mark_info.log_staff, ROW_NUMBER() OVER (ORDER BY mark_info.xID) AS 'RowRank'  from mark_info LEFT OUTER JOIN pwallet ON mark_info.log_staff=pwallet.ID   LEFT OUTER JOIN tm_type ON tm_type.xID=mark_info.tm_typeID  LEFT OUTER JOIN applicant ON applicant.log_staff=pwallet.ID    WHERE pwallet.stage='5' AND pwallet.status='", status, "' AND pwallet.data_status='", data_status, "')SELECT * FROM RSTbl  WHERE RowRank BETWEEN '", start, "' AND '", limit, "' " }), connection);
            //}
            //else if ((status == "4") && ((data_status == "Registrable") || (data_status == "Non-registrable")))
            //{
            //    command = new SqlCommand(string.Concat(new object[] { "WITH RSTbl AS (select   pwallet.rtm,pwallet.visible,pwallet.applicantID,applicant.xname,mark_info.national_classID 'class',mark_info.xID,mark_info.reg_number 'reg_no',mark_info.product_title,tm_type.type 'tm_type',pwallet.validationID 'oai_no', ISNULL(pwallet.data_status,'None') 'xstat', mark_info.reg_date 'reg_dt',mark_info.log_staff, ROW_NUMBER() OVER (ORDER BY mark_info.xID) AS 'RowRank'  from mark_info LEFT OUTER JOIN pwallet ON mark_info.log_staff=pwallet.ID   LEFT OUTER JOIN tm_type ON tm_type.xID=mark_info.tm_typeID  LEFT OUTER JOIN applicant ON applicant.log_staff=pwallet.ID    WHERE pwallet.stage='5' AND pwallet.status='", status, "' AND ((pwallet.data_status='Non-registrable') OR (pwallet.data_status='Registrable'))  )SELECT * FROM RSTbl  WHERE RowRank BETWEEN '", start, "' AND '", limit, "' " }), connection);
            //}
            //else if ((status == "1") && ((data_status == "Fresh") || (data_status == "Invalid")))
            //{
            //    command = new SqlCommand(string.Concat(new object[] { "WITH RSTbl AS (select   pwallet.rtm,pwallet.visible,pwallet.applicantID,applicant.xname,mark_info.national_classID 'class',mark_info.xID,mark_info.reg_number 'reg_no',mark_info.product_title,tm_type.type 'tm_type',pwallet.validationID 'oai_no', ISNULL(pwallet.data_status,'None') 'xstat', mark_info.reg_date 'reg_dt',mark_info.log_staff, ROW_NUMBER() OVER (ORDER BY mark_info.xID) AS 'RowRank'  from mark_info LEFT OUTER JOIN pwallet ON mark_info.log_staff=pwallet.ID   LEFT OUTER JOIN tm_type ON tm_type.xID=mark_info.tm_typeID  LEFT OUTER JOIN applicant ON applicant.log_staff=pwallet.ID     WHERE pwallet.stage='5' AND pwallet.status='", status, "' AND (pwallet.data_status='Fresh' OR pwallet.data_status='Invalid') )SELECT * FROM RSTbl  WHERE RowRank BETWEEN '", start, "' AND '", limit, "' " }), connection);
            //}
            //else if ((status == "8") && (data_status == "Registered"))
            //{
            //    command = new SqlCommand(string.Concat(new object[] { "WITH RSTbl AS (select   pwallet.rtm,pwallet.visible,pwallet.applicantID,applicant.xname,mark_info.national_classID 'class',mark_info.xID,mark_info.reg_number 'reg_no',mark_info.product_title,tm_type.type 'tm_type',pwallet.validationID 'oai_no', ISNULL(pwallet.data_status,'None') 'xstat', mark_info.reg_date 'reg_dt',mark_info.log_staff, ROW_NUMBER() OVER (ORDER BY mark_info.xID) AS 'RowRank'  from mark_info LEFT OUTER JOIN pwallet ON mark_info.log_staff=pwallet.ID   LEFT OUTER JOIN tm_type ON tm_type.xID=mark_info.tm_typeID  LEFT OUTER JOIN applicant ON applicant.log_staff=pwallet.ID     WHERE pwallet.stage='5' AND pwallet.status>'", status, "' AND pwallet.data_status='", data_status, "' )SELECT * FROM RSTbl  WHERE RowRank BETWEEN '", start, "' AND '", limit, "' " }), connection);
            //}
            //else if ((status == "5") && (data_status == "acc_printed"))
            //{
            //    command = new SqlCommand(string.Concat(new object[] { "WITH RSTbl AS (select   pwallet.rtm,pwallet.visible,pwallet.applicantID,applicant.xname,mark_info.national_classID 'class',mark_info.xID,mark_info.reg_number 'reg_no',mark_info.product_title,tm_type.type 'tm_type',pwallet.validationID 'oai_no', ISNULL(pwallet.data_status,'None') 'xstat', mark_info.reg_date 'reg_dt',mark_info.log_staff, ROW_NUMBER() OVER (ORDER BY mark_info.xID) AS 'RowRank'  from mark_info LEFT OUTER JOIN pwallet ON mark_info.log_staff=pwallet.ID   LEFT OUTER JOIN tm_type ON tm_type.xID=mark_info.tm_typeID  LEFT OUTER JOIN applicant ON applicant.log_staff=pwallet.ID     WHERE pwallet.stage='5' AND pwallet.acc_p='1' )SELECT * FROM RSTbl  WHERE RowRank BETWEEN '", start, "' AND '", limit, "' " }), connection);
            //}
            //else
            //{

            //command = new SqlCommand(string.Concat(new object[] { "select   pwallet.rtm,pwallet.TransactionId,pwallet.visible,pwallet.applicantID,pwallet.applicantID,applicant.xname,mark_info.national_classID 'class',mark_info.xID,mark_info.reg_number 'reg_no',mark_info.product_title,tm_type.type 'tm_type',pwallet.validationID 'oai_no', ISNULL(pwallet.data_status,'None') 'xstat', mark_info.reg_date 'reg_dt',mark_info.log_staff  from mark_info LEFT OUTER JOIN pwallet ON mark_info.log_staff=pwallet.ID   LEFT OUTER JOIN tm_type ON tm_type.xID=mark_info.tm_typeID  LEFT OUTER JOIN applicant ON applicant.log_staff=pwallet.ID     WHERE pwallet.stage='5' AND pwallet.status>='", status, "' AND pwallet.data_status='", data_status, "'  and pwallet.validationID ='", pvalidation, "' order by pwallet.rtm DESC     " }), connection);
            command = new SqlCommand(string.Concat(new object[] { "select g_tm_info.tm_title 'tm_title',g_pwallet.ID,g_tm_info.tm_class 'xclass',g_applicant_info.xname,g_applicant_info.address,g_applicant_info.xemail,g_applicant_info.xmobile, g_pwallet.log_officer,g_pwallet.validationID ,g_pwallet.applicantID,g_pwallet.TransactionId,g_tm_info.reg_number,g_tm_info.xID,g_app_info.rtm_number,g_app_info.application_no,g_app_info.item_code,g_app_info.filing_date,g_app_info.reg_no, g_app_info.reg_date,g_app_info.log_staff,g_app_info.visible,g_applicant_info.xname from g_app_info   LEFT OUTER JOIN g_tm_info ON g_app_info.log_staff=g_tm_info.log_staff   LEFT OUTER JOIN g_pwallet ON g_app_info.log_staff=g_pwallet.ID LEFT OUTER JOIN g_applicant_info on  g_pwallet.id=g_applicant_info.log_staff  WHERE  g_app_info.application_no ='", pvalidation, "'   " }), connection); ;
            // g_app_info.reg_date,g_app_info.log_staff,g_app_info.visible from g_app_info   LEFT OUTER JOIN g_tm_info ON g_app_info.log_staff=g_tm_info.log_staff

            //  }

            // command.CommandTimeout = 0;
            connection.Open();
            SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
            string pp2 = "";
            int vcount = 0;
            int vsn = 0;
            string voffice = "";
            while (reader.Read())
            {
                vsn = vsn + 1;
                vcount = vcount + 1;

                XObjs.Registration pdd = getRegistrationBySubagentRegistrationID(reader["applicantID"].ToString());
                //if (getTmOfficeByMID(reader["log_staff"].ToString()) != "")
                //{
                //    voffice = (getTmOfficeByMID(reader["log_staff"].ToString()));
                //}
                //else
                //{
                //    voffice = "None";
                //}
                XObjs.Office_view item = new XObjs.Office_view
                {
                    xid = reader["xID"].ToString(),
                    rtm = reader["rtm_number"].ToString(),
                    applicant_name = reader["xname"].ToString(),
                    xclass = reader["xclass"].ToString(),
                    reg_no = reader["application_no"].ToString(),
                    Xaddress = reader["address"].ToString(),
                    Xemail = reader["xemail"].ToString(),
                    Xmobile = reader["xmobile"].ToString(),
                    // tm_type = reader["tm_type"].ToString(),
                    product_title = reader["tm_title"].ToString(),
                    oai_no = reader["validationID"].ToString(),
                    //  xstat = reader["xstat"].ToString(),
                    reg_dt = reader["reg_date"].ToString(),
                    log_staff = reader["log_staff"].ToString(),
                    //   batches = reader["visible"].ToString(),
                    applicantID = reader["applicantID"].ToString(),

                    //Office = reader["data_status"].ToString(),
                    Sn = Convert.ToString(vsn),
                    Agent_Code = pdd.Sys_ID,
                    Agent_Name = pdd.Surname,
                    TransactionId = reader["TransactionId"].ToString(),
                    id = reader["ID"].ToString()
                };

                try
                {
                    int dw = Convert.ToInt32(reader["visible"]);
                    if (dw > 1)
                    {
                        pp2 = (Convert.ToInt32(reader["visible"]) - 1).ToString();

                    }

                    else
                    {
                        pp2 = (Convert.ToInt32(reader["visible"])).ToString();

                    }
                }
                catch (Exception ee)
                {

                }

                item.batches = pp2;
                list.Add(item);

            }
            reader.Close();
            connection.Close();
            return list;
        }
Example #4
0
        public List<XObjs.Office_view> getNew_MarkInfoRSX2(string status, string data_status, int start, int limit)
        {
            SqlCommand command;
            List<XObjs.Office_view> list = new List<XObjs.Office_view>();
            new XObjs.Office_view();
            SqlConnection connection = new SqlConnection(this.Connect());
            //if ((status == "4") && (data_status == "Refused"))
            //{
            //    command = new SqlCommand(string.Concat(new object[] { "WITH RSTbl AS (select  pwallet.rtm,pwallet.visible,pwallet.applicantID,applicant.xname,mark_info.national_classID 'class',mark_info.xID,mark_info.reg_number 'reg_no',mark_info.product_title,tm_type.type 'tm_type',pwallet.validationID 'oai_no', ISNULL(pwallet.data_status,'None') 'xstat', mark_info.reg_date 'reg_dt',mark_info.log_staff, ROW_NUMBER() OVER (ORDER BY mark_info.xID) AS 'RowRank'  from mark_info LEFT OUTER JOIN pwallet ON mark_info.log_staff=pwallet.ID   LEFT OUTER JOIN tm_type ON tm_type.xID=mark_info.tm_typeID  LEFT OUTER JOIN applicant ON applicant.log_staff=pwallet.ID    WHERE pwallet.stage='5' AND pwallet.status='", status, "' AND pwallet.data_status='", data_status, "')SELECT * FROM RSTbl  WHERE RowRank BETWEEN '", start, "' AND '", limit, "' " }), connection);
            //}
            //else if ((status == "4") && ((data_status == "Registrable") || (data_status == "Non-registrable")))
            //{
            //    command = new SqlCommand(string.Concat(new object[] { "WITH RSTbl AS (select   pwallet.rtm,pwallet.visible,pwallet.applicantID,applicant.xname,mark_info.national_classID 'class',mark_info.xID,mark_info.reg_number 'reg_no',mark_info.product_title,tm_type.type 'tm_type',pwallet.validationID 'oai_no', ISNULL(pwallet.data_status,'None') 'xstat', mark_info.reg_date 'reg_dt',mark_info.log_staff, ROW_NUMBER() OVER (ORDER BY mark_info.xID) AS 'RowRank'  from mark_info LEFT OUTER JOIN pwallet ON mark_info.log_staff=pwallet.ID   LEFT OUTER JOIN tm_type ON tm_type.xID=mark_info.tm_typeID  LEFT OUTER JOIN applicant ON applicant.log_staff=pwallet.ID    WHERE pwallet.stage='5' AND pwallet.status='", status, "' AND ((pwallet.data_status='Non-registrable') OR (pwallet.data_status='Registrable'))  )SELECT * FROM RSTbl  WHERE RowRank BETWEEN '", start, "' AND '", limit, "' " }), connection);
            //}
            //else if ((status == "1") && ((data_status == "Fresh") || (data_status == "Invalid")))
            //{
            //    command = new SqlCommand(string.Concat(new object[] { "WITH RSTbl AS (select   pwallet.rtm,pwallet.visible,pwallet.applicantID,applicant.xname,mark_info.national_classID 'class',mark_info.xID,mark_info.reg_number 'reg_no',mark_info.product_title,tm_type.type 'tm_type',pwallet.validationID 'oai_no', ISNULL(pwallet.data_status,'None') 'xstat', mark_info.reg_date 'reg_dt',mark_info.log_staff, ROW_NUMBER() OVER (ORDER BY mark_info.xID) AS 'RowRank'  from mark_info LEFT OUTER JOIN pwallet ON mark_info.log_staff=pwallet.ID   LEFT OUTER JOIN tm_type ON tm_type.xID=mark_info.tm_typeID  LEFT OUTER JOIN applicant ON applicant.log_staff=pwallet.ID     WHERE pwallet.stage='5' AND pwallet.status='", status, "' AND (pwallet.data_status='Fresh' OR pwallet.data_status='Invalid') )SELECT * FROM RSTbl  WHERE RowRank BETWEEN '", start, "' AND '", limit, "' " }), connection);
            //}
            //else if ((status == "8") && (data_status == "Registered"))
            //{
            //    command = new SqlCommand(string.Concat(new object[] { "WITH RSTbl AS (select   pwallet.rtm,pwallet.visible,pwallet.applicantID,applicant.xname,mark_info.national_classID 'class',mark_info.xID,mark_info.reg_number 'reg_no',mark_info.product_title,tm_type.type 'tm_type',pwallet.validationID 'oai_no', ISNULL(pwallet.data_status,'None') 'xstat', mark_info.reg_date 'reg_dt',mark_info.log_staff, ROW_NUMBER() OVER (ORDER BY mark_info.xID) AS 'RowRank'  from mark_info LEFT OUTER JOIN pwallet ON mark_info.log_staff=pwallet.ID   LEFT OUTER JOIN tm_type ON tm_type.xID=mark_info.tm_typeID  LEFT OUTER JOIN applicant ON applicant.log_staff=pwallet.ID     WHERE pwallet.stage='5' AND pwallet.status>'", status, "' AND pwallet.data_status='", data_status, "' )SELECT * FROM RSTbl  WHERE RowRank BETWEEN '", start, "' AND '", limit, "' " }), connection);
            //}
            //else if ((status == "5") && (data_status == "acc_printed"))
            //{
            //    command = new SqlCommand(string.Concat(new object[] { "WITH RSTbl AS (select   pwallet.rtm,pwallet.visible,pwallet.applicantID,applicant.xname,mark_info.national_classID 'class',mark_info.xID,mark_info.reg_number 'reg_no',mark_info.product_title,tm_type.type 'tm_type',pwallet.validationID 'oai_no', ISNULL(pwallet.data_status,'None') 'xstat', mark_info.reg_date 'reg_dt',mark_info.log_staff, ROW_NUMBER() OVER (ORDER BY mark_info.xID) AS 'RowRank'  from mark_info LEFT OUTER JOIN pwallet ON mark_info.log_staff=pwallet.ID   LEFT OUTER JOIN tm_type ON tm_type.xID=mark_info.tm_typeID  LEFT OUTER JOIN applicant ON applicant.log_staff=pwallet.ID     WHERE pwallet.stage='5' AND pwallet.acc_p='1' )SELECT * FROM RSTbl  WHERE RowRank BETWEEN '", start, "' AND '", limit, "' " }), connection);
            //}
            //else
            //{
            command = new SqlCommand(string.Concat(new object[] { "select   pwallet.rtm,pwallet.visible,pwallet.applicantID,applicant.xname,mark_info.national_classID 'class',mark_info.xID,mark_info.reg_number 'reg_no',mark_info.product_title,tm_type.type 'tm_type',pwallet.validationID 'oai_no', ISNULL(pwallet.data_status,'None') 'xstat', mark_info.reg_date 'reg_dt',mark_info.log_staff  from mark_info LEFT OUTER JOIN pwallet ON mark_info.log_staff=pwallet.ID   LEFT OUTER JOIN tm_type ON tm_type.xID=mark_info.tm_typeID  LEFT OUTER JOIN applicant ON applicant.log_staff=pwallet.ID     WHERE pwallet.stage='5' AND pwallet.status='", status, "' AND pwallet.data_status='", data_status, "'      " }), connection);
            //  }
            // command.CommandTimeout = 0;
            connection.Open();
            SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
            string pp2 = "";
            int vcount = 0;
            int vsn = 0;
            string voffice = "";
            while (reader.Read())
            {
                vsn = vsn + 1;
                vcount = vcount + 1;

                //if (getTmOfficeByMID(reader["log_staff"].ToString()) != "")
                //{
                //    voffice = (getTmOfficeByMID(reader["log_staff"].ToString()));
                //}
                //else
                //{
                //    voffice = "None";
                //}
                XObjs.Office_view item = new XObjs.Office_view
                {
                    xid = reader["xID"].ToString(),
                    rtm = reader["rtm"].ToString(),
                    applicant_name = reader["xname"].ToString(),
                    xclass = reader["class"].ToString(),
                    reg_no = reader["reg_no"].ToString(),
                    tm_type = reader["tm_type"].ToString(),
                    product_title = reader["product_title"].ToString(),
                    oai_no = reader["oai_no"].ToString(),
                    xstat = reader["xstat"].ToString(),
                    reg_dt = reader["reg_dt"].ToString(),
                    log_staff = reader["log_staff"].ToString(),
                    //   batches = reader["visible"].ToString(),
                    applicantID = reader["visible"].ToString(),

                    //Office = reader["data_status"].ToString(),
                    Sn = Convert.ToString(vsn)
                };

                try
                {
                    int dw = Convert.ToInt32(reader["visible"]);
                    if (dw > 1)
                    {
                        pp2 = (Convert.ToInt32(reader["visible"]) - 1).ToString();

                    }

                    else
                    {
                        pp2 = (Convert.ToInt32(reader["visible"])).ToString();

                    }
                }
                catch (Exception ee)
                {

                }

                item.batches = pp2;
                list.Add(item);

            }
            reader.Close();
            connection.Close();
            return list;
        }