protected void btnSave_Click(object sender, EventArgs e) { try { bool checkBox = true; int responce = 0; string starttime = "09:00AM"; string endtime = "6:00PM"; if (ddlDays.SelectedItem.Text != "Weekly") { responce = SS.PostEquipmentScheduling(Convert.ToInt32(ddlObject.SelectedValue), starttime, endtime, Convert.ToInt32(ddlDays.SelectedValue), Convert.ToInt32(ddlSensor.SelectedValue), checkBox); if (responce > 0) { GvdBindObjdetail(Convert.ToInt32(ddlObject.SelectedValue), Convert.ToInt32(ddlDays.SelectedValue)); _alert = AlertsClass.SuccessAdd; } } if (ddlDays.SelectedItem.Text == "Weekly") { for (int i = 1; i < 8; i++) { int days = i; responce = SS.PostEquipmentScheduling(Convert.ToInt32(ddlObject.SelectedValue), starttime, endtime, days, Convert.ToInt32(ddlSensor.SelectedValue), checkBox); _alert = AlertsClass.SuccessAdd; } GvdBindObjdetail(Convert.ToInt32(ddlObject.SelectedValue), Convert.ToInt32(ddlDays.SelectedValue)); } BindddlSensor(); allowStaticMethods("ALerts('" + _alert + "');staticMethod();"); } catch (Exception) { BindingClass.ExceptionAlertScriptManager(this.Page, this.GetType()); } }