public void Edit_driver_details(string d_id)
        {
            bt_sbt.Visible = false;
            udpt.Visible   = true;

            txt_licence.ReadOnly = true;
            ds = con.FN_ExecuteQuerySingle("select name,licence_n,p_address,r_address,email,mobile,format(convert(date,dob),'dd-MM-yyyy') as dob ,typeOFveh from MSt_driver_Reg where licence_n='" + d_id + "'");
            string name = ds.Tables[0].Rows[0]["name"].ToString();


            txt_name.Text    = name;
            txt_licence.Text = ds.Tables[0].Rows[0]["licence_n"].ToString();
            txt_p_add.Text   = ds.Tables[0].Rows[0]["p_address"].ToString();
            txt_c_add.Text   = ds.Tables[0].Rows[0]["r_address"].ToString();
            txt_email.Text   = ds.Tables[0].Rows[0]["email"].ToString();
            // txt_licence.Text = ds.Tables[0].Rows[0]["licence_n"].ToString();
            txt_mbl.Text = ds.Tables[0].Rows[0]["mobile"].ToString();
            txt_dob.Text = ds.Tables[0].Rows[0]["dob"].ToString();

            string veh = ds.Tables[0].Rows[0]["typeOFveh"].ToString();
            string vh  = "Previous Select:- " + " " + veh.Replace("_", ",");

            if (veh != "")
            {
                lbl_msg.Visible = true;
                lbl_msg.Text    = vh;
            } //string v1 = veh.Split("_".ToCharArray())[0];
              //string v2 = veh.Split("_".ToCharArray())[1];
              //string v3 = veh.Split("_".ToCharArray())[2];
              //if (v1 == "Dumper")
              //{
              //    //chk_veh.ThreeState= true;

            //}
        }
Example #2
0
        protected void Ddlword_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataSet ds     = new DataSet();
            string  zone   = Ddlzone.SelectedValue.ToString();
            string  wadrid = Ddlword.SelectedValue.ToString();
            string  strsql = "proc_select_feeders_wardwise '" + zone + "','" + wadrid + "'";

            ds = con.FN_ExecuteQuerySingle(strsql);
            GridView1.DataSource = ds;
            GridView1.DataBind();
        }
Example #3
0
        protected void BIND_ddl_zone()
        {
            DataSet ddl_z = con.FN_ExecuteQuerySingle("select *from zone_master");

            ddl_zone.DataSource     = ddl_z;
            ddl_zone.DataTextField  = "Zone_Name";
            ddl_zone.DataValueField = "Zone_id";
            ddl_zone.DataBind();
            ddl_zone.Items.Add(new ListItem("--Select--", "0"));
            ddl_zone.SelectedValue = "0";
        }
Example #4
0
        public void BindWards(string zone)    //created By Gajendra Singh
        {
            DataSet ds     = new DataSet();
            string  strsql = "BindWardonSelect_Zone '" + zone + "'";

            ds = con.FN_ExecuteQuerySingle(strsql);
            Ddlword.DataSource     = ds;
            Ddlword.DataTextField  = "ward_name";
            Ddlword.DataValueField = "ward_id";
            Ddlword.DataBind();
            Ddlword.Items.Add(new ListItem("--Select--", "0"));
            Ddlword.SelectedValue = "0";
        }
        public static string fn_change_routesss(string binid, string binName, string lat, string lon, string zone, string ward, string rid)
        {
            DataSet     ds    = new DataSet();
            connections con   = new connections();
            DateTime    today = DateTime.Today;
            DataSet     type  = new DataSet();

            type = con.FN_ExecuteQuerySingle("select Type,Priority from Mst_Bin where BinId='" + binid + "'");
            string typ   = type.Tables[0].Rows[0]["Type"].ToString();
            string prior = type.Tables[0].Rows[0]["Priority"].ToString();

            ds = con.FN_ExecuteQuerySingle("FN_change_route_rt_proc" + "'" + binid + "','" + binName + "','" + lat + "','" + lon + "','" + typ + "','" + prior + "','" + zone + "','" + ward + "','" + rid + "','" + today + "'");

            return("s");
        }
Example #6
0
 protected void submit_Click(object sender, EventArgs e)
 {
     if ((Uid.Value != "" || Uid.Value != null) && (pass.Value != "" || pass.Value != null))
     {
         try
         {
             DataSet ds = new DataSet();
             ds = con.FN_ExecuteQuerySingle("select * from MST_USER where username='******' and   userpassword='******'");// and usertype='"++
             if (ds.Tables[0].Rows.Count > 0)
             {
                 if (ds.Tables[0].Rows[0]["usertype"].ToString() == "A")
                 {
                     Session["uid"]  = Uid.Value;
                     Session["type"] = ds.Tables[0].Rows[0]["usertype"].ToString();
                     string sest = Session["type"].ToString();
                     Response.Redirect("Home_page.aspx");//cityid=" + ds.Tables[0].Rows[0]["cityid"].ToString()
                 }
                 if (ds.Tables[0].Rows[0]["usertype"].ToString() == "U")
                 {
                     Session["uid"]  = Uid.Value;
                     Session["type"] = ds.Tables[0].Rows[0]["usertype"].ToString();
                     string sess = Session["type"].ToString();
                     Response.Redirect("Home_page.aspx");
                 }
             }
             else
             {
                 MessageBox.Show("User Does not Exist!!");
             }
         }
         catch { }
     }
 }
Example #7
0
        public static string fn_assignment(string binid, string lat, string lon, string rid)
        {
            DataSet     assign = new DataSet();
            connections ob     = new connections();

            assign = ob.FN_ExecuteQuerySingle("update Mst_Bin set routeid='" + rid + "',Latitude='" + lat + "' ,Longitude='" + lon + "' where BinId='" + binid + "'");
            return("0");
        }
        public static string fn_Select_bins(string binid)
        {
            DataSet     ds  = new DataSet();
            connections con = new connections();

            ds = con.FN_ExecuteQuerySingle("select * from Mst_Bin where BinId='" + binid + "' and StatusB='A'");
            return("0");
        }
Example #9
0
        public static string fn_del_bin(string routeid)
        {
            DataSet     ds  = new DataSet();
            connections con = new connections();

            ds = con.FN_ExecuteQuerySingle("delete from Mst_Route_Planner where routid='" + routeid + "'");
            return("0");
        }
        public static string fn_del_bin(string binid)
        {
            DataSet     ds  = new DataSet();
            business    ob  = new business();
            connections con = new connections();

            ds = con.FN_ExecuteQuerySingle("update Mst_Bin_Collection set status='D' where binid='" + binid + "'");
            return("0");
        }
Example #11
0
        public MAPS[] init_get_car()
        {
            List <MAPS> lstMarkers = new List <MAPS>();
            connections con        = new connections();
            DataSet     ds         = new DataSet();
            DataSet     ds1        = new DataSet();
            DataTable   dt         = new DataTable();

            System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
            List <Dictionary <string, object> > rows = new List <Dictionary <string, object> >();

            dt.Columns.Add("lat");
            dt.Columns.Add("lon");
            dt.Columns.Add("type");



            ds1 = con.FN_ExecuteQuerySingle("select lat,lon from Car_LAT_LON");

            if (ds1.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
                {
                    DataRow dr = dt.NewRow();
                    dr["lat"] = ds1.Tables[0].Rows[i]["lat"].ToString();
                    dr["lon"] = ds1.Tables[0].Rows[i]["lon"].ToString();
                    dt.Rows.Add(dr);
                }
            }
            else
            {
                DataRow dr = dt.NewRow();
                dr["lat"]  = "23.235846";
                dr["lon"]  = "77.3980373";
                dr["type"] = "D";


                dt.Rows.Add(dr);
            }



            foreach (DataRow dtrow in dt.Rows)
            {
                MAPS objMAPS = new MAPS();

                objMAPS.lat  = dtrow[0].ToString();
                objMAPS.lon  = dtrow[1].ToString();
                objMAPS.type = dtrow[2].ToString();

                lstMarkers.Add(objMAPS);
            }
            return(lstMarkers.ToArray());
        }
Example #12
0
        public MAPS[] fn_get_car(string lat, string lon)
        {
            List <MAPS> lstMarkers = new List <MAPS>();
            connections con        = new connections();
            DataSet     ds         = new DataSet();
            DataSet     ds1        = new DataSet();
            DataTable   dt         = new DataTable();

            System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
            List <Dictionary <string, object> > rows = new List <Dictionary <string, object> >();

            dt.Columns.Add("lat");
            dt.Columns.Add("lon");

            ds = con.FN_ExecuteQuerySingle("insert into Car_LAT_LON (lat,lon) values('" + lat + "','" + lon + "')");


            ds1 = con.FN_ExecuteQuerySingle("select lat,lon from Car_LAT_LON");

            if (ds1.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
                {
                    DataRow dr = dt.NewRow();
                    dr["lat"] = ds1.Tables[0].Rows[i]["lat"].ToString();
                    dr["lon"] = ds1.Tables[0].Rows[i]["lon"].ToString();
                    dt.Rows.Add(dr);
                }
            }
            foreach (DataRow dtrow in dt.Rows)
            {
                MAPS objMAPS = new MAPS();

                objMAPS.lat = dtrow[0].ToString();
                objMAPS.lon = dtrow[1].ToString();

                lstMarkers.Add(objMAPS);
            }
            return(lstMarkers.ToArray());
        }
Example #13
0
        public static string fn_insert_routes(string ward, string route)
        {
            connections con = new connections();
            DataSet     ds  = new DataSet();

            try
            {
                ds = con.FN_ExecuteQuerySingle("INERT_ROUTE_proc" + "'" + ward + "','" + route + "'");

                string msg = ds.Tables[0].Rows[0]["msg"].ToString();

                return(msg);
            }
            catch {
                return("0");
            }
        }
        public static string fn_Schedule_bins_(string mar, string veh, string vtype, string driverID, string dname)
        {
            DateTime    today = DateTime.Today;
            DataSet     dm    = new DataSet();
            DataSet     ds    = new DataSet();
            connections con   = new connections();

            try
            {
                string[] slice = mar.Split(',');
                for (int ij = 0; ij < slice.Length; ij++)
                {
                    DataSet check = new DataSet();

                    //check = con.FN_ExecuteQuerySingle("Fn_check_proc_"+"'" + slice[ij] + "'");

                    dm = con.FN_ExecuteQuerySingle("select * from Mst_Bin where BinId='" + slice[ij] + "'");
                    string bin_name = dm.Tables[0].Rows[0]["BinName"].ToString();
                    string z_id     = dm.Tables[0].Rows[0]["Zoneid"].ToString();
                    string w_id     = dm.Tables[0].Rows[0]["wardid"].ToString();
                    string r_id     = dm.Tables[0].Rows[0]["routeid"].ToString();
                    dm = con.FN_ExecuteQuerySingle("select Zone_Name from zone_master where Zone_id='" + z_id + "'");
                    string z_nm = dm.Tables[0].Rows[0]["Zone_Name"].ToString();
                    dm = con.FN_ExecuteQuerySingle("select ward_name from ward_master where ward_id='" + w_id + "'");
                    string w_nm = dm.Tables[0].Rows[0]["ward_name"].ToString();

                    dm = con.FN_ExecuteQuerySingle("select routeName from Mst_Route_planner where routid='" + r_id + "'");
                    string r_name = dm.Tables[0].Rows[0]["routeName"].ToString();
                    dm = con.FN_ExecuteQuerySingle("select DriverName from Mst_Drivers where DriverID='" + driverID + "'");
                    string drivernm = dm.Tables[0].Rows[0]["DriverName"].ToString();
                    dm = con.FN_ExecuteQuerySingle("select vehicle_type from Mst_Vehicles where [vehicle_num]='" + veh + "'");
                    string vh = dm.Tables[0].Rows[0]["vehicle_type"].ToString();
                    //dm=con.FN_ExecuteQuerySingle("select vehicle_num from Mst_Vehicles where routid='"+route+"'");
                    ds = con.FN_ExecuteQuerySingle("insert into Mst_Bin_Collection (binid,bin_name,zone_name,ward_name,route_name,vehicle,[Vehicle Type],[Driver ID],Driver,Date,status) values('" + slice[ij] + "','" + bin_name + "','" + z_nm + "','" + w_nm + "','" + r_name + "','" + veh + "','" + vh + "','" + driverID + "','" + drivernm + "','" + today + "','P')");
                }
            }
            catch { }



            return("0");
        }
 public void bind_grid_vehicle()
 {
     ds = con.FN_ExecuteQuerySingle("select vehicle_num,vehicle_type from Mst_Vehicles");
     grid_vehicle.DataSource = ds;
     grid_vehicle.DataBind();
 }
Example #16
0
        public string zonewstable(string zoneid)
        {
            string returnvalue = "";

            ds = con.FN_ExecuteQuerySingle("FN_select_policy" + "'" + zoneid + "'");



            foreach (DataTable dt in ds.Tables)
            {
                returnvalue = returnvalue + DataTableToJSONWithStringBuilder(dt);
            }


            return(returnvalue);
        }
Example #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ds = ob.fn_get_z_name();

                ddlZone.DataTextField  = "Zone_Name";
                ddlZone.DataValueField = "Zone_id";
                ddlZone.DataSource     = ds;
                ddlZone.DataBind();
                ddlZone.Items.Add(new ListItem("--Select--", "0"));
                ddlZone.SelectedValue = "0";


                ds = con.FN_ExecuteQuerySingle(" Select *,CONVERT(VARCHAR(10),allotmentDT,103)as date from Mst_Driver_Vehicle_Allotment  order by AllotmentLongDT desc");

                if (ds.Tables[0].Rows.Count > 0)
                {
                    grdDefault.DataSource = ds;
                    grdDefault.DataBind();
                }
                else
                {
                    grdDefault.DataSource = null;
                    grdDefault.DataBind();
                }
            }
            dvgrvDetails.Visible = false;
        }
Example #18
0
 public void BindGrid_Driver()
 {
     ds = con.FN_ExecuteQuerySingle("select name,licence_n,p_address,r_address,email,mobile,format(convert(date,dob),'dd-MM-yyyy') as dob ,typeOFveh from MSt_driver_Reg");
     grdDriver.DataSource = ds;
     grdDriver.DataBind();
 }