Exemple #1
0
        public void update_plan()
        {
            DataSet update_plan = new DataSet();

            DateTime today = DateTime.Today;

            try
            {
                if (ListRight.Items.Count > 0)
                {
                    for (int c = 0; c < ListRight.Items.Count; c++)
                    {
                        DataSet get_bin = new DataSet();
                        get_bin = con.FN_ExecuteQuerySingle("select BinId,BinName,Latitude,Longitude,Priority,Type from Mst_Bin where BinId='" + ListRight.Items[c].Value + "' and StatusB='A'");
                        string b_id       = get_bin.Tables[0].Rows[0]["BinId"].ToString();
                        string b_name     = get_bin.Tables[0].Rows[0]["BinName"].ToString();
                        string b_lat      = get_bin.Tables[0].Rows[0]["Latitude"].ToString();
                        string b_lon      = get_bin.Tables[0].Rows[0]["Longitude"].ToString();
                        string b_priority = get_bin.Tables[0].Rows[0]["Priority"].ToString();
                        string b_type     = get_bin.Tables[0].Rows[0]["Type"].ToString();
                        string b_Sequence = Convert.ToInt32(c + 1).ToString();

                        DataSet ins_bin = new DataSet();
                        ins_bin = ob.FN_insert_bins(b_id, b_name, b_lat, b_lon, b_type, b_priority, b_Sequence, today);
                    }
                    MessageBox.Show("Schedule Updated Successfully");
                }
                else
                {
                    MessageBox.Show("LIST IS EMPTY");
                }
            }


            catch { }
        }