protected void AdmnRgstr_Click(object sender, EventArgs e) { bo ob1 = new bo(); ob1.FName = frstName.Text; ob1.LName = lastName.Text; ob1.Age = int.Parse(Age.Text); ob1.Gender = DropDownList2.Text; ob1.Contact = long.Parse(contactNo.Text); ob1.Uname = UserId.Text; ob1.Upwd = password.Text; ob1.UserType = UserType.Text; ob1.SkillSet = SkillSet.Text; ob1.IsActive = true; ob1.ApprovedBy = "Admin"; ob1.ApprovedOn = DateTime.Now; bal sba1 = new bal(); dt = sba1.AddBALRecord(ob1); if (dt > 0) { frstName.Text = lastName.Text = Age.Text = DropDownList2.Text = contactNo.Text = SkillSet.Text = UserId.Text = password.Text = UserType.Text = ""; lblMsg.Text = "Record Added Successfully"; } else { lblMsg.Text = "Try Again"; } }
public DataTable select_state(bal b) { da = new SqlDataAdapter("select * from tblstate where refc_id=@id", con); da.SelectCommand.Parameters.AddWithValue("@id", b.refcountry_id); dt = new DataTable(); da.Fill(dt); return(dt); }
public void delete_COUNTRY(bal b) { con.Open(); cmd = new SqlCommand("delete from tblcountry where Id=@id", con); cmd.Parameters.AddWithValue("@id", b.country_id); cmd.ExecuteNonQuery(); con.Close(); }
public void INSERT_COUNTRY(bal b) { con.Open(); cmd = new SqlCommand("insert into tblcountry values(@cnm,@isactive)", con); cmd.Parameters.AddWithValue("@cnm", b.country_name); cmd.Parameters.AddWithValue("@isactive", b.isactivecountry); cmd.ExecuteNonQuery(); con.Close(); }
public void update_COUNTRY(bal b) { con.Open(); cmd = new SqlCommand("update tblcountry set country_name=@cnm,isactive=@isactive where Id=@id", con); cmd.Parameters.AddWithValue("@cnm", b.country_name); cmd.Parameters.AddWithValue("@isactive", b.isactivecountry); cmd.Parameters.AddWithValue("@id", b.country_id); cmd.ExecuteNonQuery(); con.Close(); }
void Solve() { //заполняем позиции topPos[0].x = 15; topPos[1].x = 71; topPos[2].x = 42; topPos[0].y = 30; topPos[1].y = 10; topPos[2].y = 10; botPos[0].x = 15; botPos[1].x = 71; botPos[2].x = 42; botPos[0].y = 30; botPos[1].y = 50; botPos[2].y = 50; int[,] beetveners = new int[5, 5]; int tick = ReadInt(); int MYgols = ReadInt(); ENgols = ReadInt(); bal[] mine = new bal[5]; bal[] wher = new bal[6]; bal[] enem = new bal[5]; pair Ball; Ball.x = ReadDouble(); Ball.y = ReadDouble(); Ball.xv = ReadDouble(); Ball.yv = ReadDouble(); for (int i = 0; i < 5; i++) { mine[i].x = ReadDouble(); mine[i].y = ReadDouble(); } for (int i = 0; i < 5; i++) { enem[i].x = ReadDouble(); enem[i].y = ReadDouble(); } memory = ReadInt(); pairr[] toPas = new pairr[5]; goToPos(mine, wher, Ball); for (int i = 0; i < 5; i++) { //если мяч близко //если мяч у нас // if (isBallOur(i, mine, Ball)) //{ if (i == golkeep)//мяч у "вратаря" { int[] whithout = new int[4]; whithout[0] = golkeep; whithout[1] = farer; whithout[2] = -1; whithout[3] = -1; int k = clos(mine, mine[golkeep].x, mine[golkeep].y, whithout); toPas[i].x = wher[k].x; toPas[i].y = wher[k].y; //wher[5].x = wher[attaker1].x; //wher[5].y = wher[attaker1].y; } else if (i == closer) { double K = Math.Sqrt((mine[farer].x - mine[closer].x) * (mine[farer].x - mine[closer].x) + (mine[farer].y - mine[closer].y) * (mine[farer].y - mine[closer].y)); if (K <= 30) { toPas[i].x = wher[farer].x; toPas[i].y = wher[farer].y; } else { toPas[i].x = -1; } } else if (i == farer) //удар по воротам { if (mine[farer].x >= 70) //иначе не долетит { toPas[i].x = 100; toPas[i].y = wher[farer].y; } else { toPas[i].x = -1; toPas[i].y = wher[farer].y; } } else if (i == attaker1)// { toPas[i].x = wher[closer].x; toPas[i].y = wher[closer].y; } else if (i == attaker2)//кто ближе farer или closer { int[] whithout = new int[5]; whithout[0] = attaker1; whithout[1] = attaker2; whithout[2] = golkeep; int k = clos(mine, mine[attaker2].x, mine[attaker2].y, whithout); toPas[i].x = wher[k].x; toPas[i].y = wher[k].y; } // } } for (int i = 0; i < 5; i++) { Write(wher[i].x, wher[i].y); } int t = clos(mine, Ball.x, Ball.y); if (toPas[t].x != -1) { Write(toPas[t].x, toPas[t].y); } }
public string save(Class1 obj) { bal b = new bal(); return(b.save(obj)); }