Exemplo n.º 1
0
 public void GetStateCity(DropDownList ddlCityState, int Type, int stateCode)
 {
     osubmit = new submitData();
     osubmit.GetConection();
     if (Type == 0)
     {
         da = new SqlDataAdapter("select cityname,citycode from citydet  where cityType='67'", osubmit.con);
         dt = new DataTable();
         da.Fill(dt);
         if (dt.Rows.Count > 0)
         {
             ddlCityState.DataSource     = dt;
             ddlCityState.DataTextField  = "cityname";
             ddlCityState.DataValueField = "citycode";
             ddlCityState.DataBind();
         }
         ddlCityState.Items.Insert(0, new ListItem("--Select State--", "0"));
     }
     else
     {
         da = new SqlDataAdapter("select cityname,citycode from citydet  where cityType='15' and cityrute = '" + stateCode + "'", osubmit.con);
         dt = new DataTable();
         da.Fill(dt);
         if (dt.Rows.Count > 0)
         {
             ddlCityState.DataSource     = dt;
             ddlCityState.DataTextField  = "cityname";
             ddlCityState.DataValueField = "citycode";
             ddlCityState.DataBind();
         }
         ddlCityState.Items.Insert(0, new ListItem("--Select City--", "0"));
     }
 }
Exemplo n.º 2
0
    public DataTable GetFirmDevice(string FirmCode, string status, string NoticeType)
    {
        osubmit = new submitData();
        osubmit.GetConection();
        string sql = "";

        if (NoticeType == "1")
        {
            if (status == "0")
            {
                sql = "select c.owner_name,s.code,s.DeviceNm,s.DeviceNo,s.SeizDate,'N/A'  Pno,'Seized' as PermStatus from SeizureEntry  s left join ClientMaster c on s.FirmCode = c.client_id  where s.FirmCode = '" + FirmCode + "' and s.status='" + status + "'";
            }
            else
            {
                sql = "select n.InstNo as DeviceNo,n.InstName as DeviceNm,s.SeizDate,'N/A' as Pno,case when n.PermStatus = 'P' then 'Pending' else n.PermStatus end as PermStatus from NoticeInfo n left join SeizureEntry s on s.DeviceNo = n.InstNo where n.FirmCode='" + FirmCode + "' and s.Status = '" + status + "' and isnull(n.SentStatus,'') != 'Sent' and NoticeType='" + NoticeType + "'";
            }
        }
        else
        {
            if (status == "0")
            {
                sql = "select n.FirmCode,c.owner_name,n.InstNo as DeviceNo,n.InstName as DeviceNm,s.SeizDate,n.NoticeNo as Pno,'N/A' as PermStatus from NoticeInfo n left join SeizureEntry s on s.DeviceNo = n.InstNo left join ClientMaster c on c.client_id = n.FirmCode where n.FirmCode='" + FirmCode + "' and s.Status = '1' and isnull(n.SentStatus,'') = 'Sent'";
            }
            else
            {
                sql = "select n.FirmCode,c.owner_name,n.InstNo as DeviceNo,n.InstName as DeviceNm,s.SeizDate,n.NoticeNo as Pno, case when n.PermStatus = 'P' then 'Pending' else n.PermStatus end as PermStatus from NoticeInfo n left join SeizureEntry s on s.DeviceNo = n.InstNo left join ClientMaster c on c.client_id = n.FirmCode where n.FirmCode='" + FirmCode + "' and isnull(n.SentStatus,'') != 'Sent' and NoticeType='" + NoticeType + "'";
            }
        }
        SqlDataAdapter daown = new SqlDataAdapter(sql, osubmit.con);
        DataTable      dtown = new DataTable();

        daown.Fill(dtown);
        return(dtown);
    }
Exemplo n.º 3
0
    public string GetFirmOwner(string FirmCode)
    {
        osubmit = new submitData();
        osubmit.GetConection();

        SqlDataAdapter daown = new SqlDataAdapter("select owner_name from ClientMaster where client_id='" + FirmCode + "'", osubmit.con);
        DataTable      dtown = new DataTable();

        daown.Fill(dtown);
        return(dtown.Rows[0]["owner_name"].ToString());
    }
Exemplo n.º 4
0
 public DataTable GetData(int menucode, int searchfld)
 {
     osubmit = new submitData();
     osubmit.GetConection();
     dt                 = new DataTable();
     objcmd             = new SqlCommand("getData", osubmit.con);
     objcmd.CommandType = CommandType.StoredProcedure;
     objcmd.Parameters.Add("@MenuCode", SqlDbType.Int).Value = menucode;
     objcmd.Parameters.Add("@DdlCode", SqlDbType.Int).Value  = searchfld;
     da = new SqlDataAdapter(objcmd);
     da.Fill(dt);
     return(dt);
 }
Exemplo n.º 5
0
 public void FillGrid(GridView gvDetails, string Tablenm, string Condition)
 {
     if (Condition.Trim() != "")
     {
         Condition = " where " + Condition;
     }
     osubmit = new submitData();
     osubmit.GetConection();
     da = new SqlDataAdapter("select " + GetBoundField(gvDetails) + " From " + Tablenm + Condition, osubmit.con);
     dt = new DataTable();
     da.Fill(dt);
     gvDetails.DataSource = dt;
     gvDetails.DataBind();
 }
Exemplo n.º 6
0
    public DataTable GetTableData(string Tablename, string columnNms, string Condition)
    {
        if (Condition.Trim() != "")
        {
            Condition = " where " + Condition;
        }
        osubmit = new submitData();
        osubmit.GetConection();
        SqlDataAdapter da = new SqlDataAdapter("select " + columnNms + " From " + Tablename + Condition, osubmit.con);
        DataTable      dt = new DataTable();

        da.Fill(dt);
        return(dt);
    }
Exemplo n.º 7
0
    public string getMaxcitystateCol(int type)
    {
        osubmit = new submitData();
        osubmit.GetConection();
        string sql = "";

        if (type == 1)
        {
            sql = "Select Max(citycode)+1 from citydet where cityType='67'";
        }
        else if (type == 2)
        {
            sql = "Select Max(citycode)+1 from citydet where cityType='15'";
        }
        else if (type == 3)
        {
            sql = "Select Max(citycode)+1 from citydet where cityType='582'";
        }
        SqlDataAdapter da = new SqlDataAdapter(sql, osubmit.con);
        DataTable      dt = new DataTable();

        da.Fill(dt);
        if (dt.Rows.Count > 0)
        {
            if (dt.Rows[0][0].ToString() == "")
            {
                return("1");
            }
            else
            {
                return(dt.Rows[0][0].ToString());
            }
        }
        else
        {
            return("1");
        }
    }