protected void Set_initial() { //make custom ValidationGroup >>><<<< string vgId = Guid.NewGuid().ToString(); ChangeRateTxt.ValidationGroup = vgId; AlertRateTxt.ValidationGroup = vgId; HaveChangeRate.ValidationGroup = vgId; ValidationSummary1.ValidationGroup = vgId; Save.ValidationGroup = vgId; //Colors (For Adding will be forced to choose) CarsList = db.Cars.ToList(); AddCarsListhtml.DataSource = CarsList; AddCarsListhtml.DataTextField = "CarNo"; AddCarsListhtml.DataValueField = "Id"; AddCarsListhtml.DataBind(); // (For search will be optional to choose) List<Cars> TempCarsListlist = new List<Cars>(); TempCarsListlist.Add(new Cars { CarNo = "-- select CarNo --", id = 0 }); TempCarsListlist.AddRange(CarsList); CarsSearchListtxt.DataSource = TempCarsListlist; CarsSearchListtxt.DataTextField = "CarNo"; CarsSearchListtxt.DataValueField = "Id"; CarsSearchListtxt.DataBind(); //City (For Adding will be forced to choose) ServicesList = db.Services.ToList(); BindDropDownList(ServicesList, AddServicesListhtml); // (For search will be optional to choose) List<Services> TempServiceslist = new List<Services>(); TempServiceslist.Add(new Services { Name = "-- select Services --", Id = 0 }); TempServiceslist.AddRange(ServicesList); BindDropDownList(TempServiceslist, ServicesSearchListtxt); ChangeRateTxt.Text = "0"; AlertRateTxt.Text = "0"; HaveChangeRate.Checked = true; ChangeRateTxt.Enabled = true; AlertRateTxt.Enabled = true; }
protected void Set_initial() { //make custom ValidationGroup >>><<<< string vgId = Guid.NewGuid().ToString(); Description.ValidationGroup = vgId; //before Before.ValidationGroup = vgId; RequiredFieldValidator1.ValidationGroup = vgId; // DateBefore.ValidationGroup = vgId; RequiredFieldValidator2.ValidationGroup = vgId; // AtHourBefore.ValidationGroup = vgId; //After After.ValidationGroup = vgId; RequiredFieldValidator3.ValidationGroup = vgId; // DateAfter.ValidationGroup = vgId; RequiredFieldValidator4.ValidationGroup = vgId; // AtHourAfter.ValidationGroup = vgId; //Btn And summary ValidationSummary1.ValidationGroup = vgId; Save.ValidationGroup = vgId; //CarsList (For Adding will be forced to choose) CarsList = db.Cars.ToList(); AddCarsListhtml.DataSource = CarsList; AddCarsListhtml.DataTextField = "CarNo"; AddCarsListhtml.DataValueField = "Id"; AddCarsListhtml.DataBind(); // (For search will be optional to choose) List <Cars> TempCarsListlist = new List <Cars>(); TempCarsListlist.Add(new Cars { CarNo = "-- select CarNo --", id = 0 }); TempCarsListlist.AddRange(CarsList); CarsSearchListtxt.DataSource = TempCarsListlist; CarsSearchListtxt.DataTextField = "CarNo"; CarsSearchListtxt.DataValueField = "Id"; CarsSearchListtxt.DataBind(); //Services (For Adding will be forced to choose) ServicesList = db.Services.ToList(); BindDropDownList(ServicesList, AddServicesListhtml); // (For search will be optional to choose) List <Services> TempServiceslist = new List <Services>(); TempServiceslist.Add(new Services { Name = "-- select Services --", Id = 0 }); TempServiceslist.AddRange(ServicesList); BindDropDownList(TempServiceslist, ServicesSearchListtxt); Before.Text = "0"; DateBefore.Text = ExtendedMethod.GetDateToday(); // After.Text = "0"; DateAfter.Text = ExtendedMethod.GetDateToday(); //Disable After Part Untill edit EditFlage = false; After.Enabled = false; DateAfter.Enabled = false; AtHourAfter.Enabled = false; //enable Before Part Untill edit Before.Enabled = true; DateBefore.Enabled = true; AtHourBefore.Enabled = true; }