Ejemplo n.º 1
0
        protected void linkUpdateAll_Command(object sender, CommandEventArgs e)
        {
            try
            {
                if (e.CommandName == "Update")
                {
                    int             _cmdArg = Convert.ToInt32(e.CommandArgument);
                    SchedulingModel li      = SS.GetSchedulingById(_cmdArg);
                    Session["scheduleId"] = _cmdArg.ToString();
                    int obs   = li.ObjectSensorId;
                    int _days = li.Days;

                    bool cbstatus = false;
                    var  lb       = (LinkButton)sender;
                    var  row      = (GridViewRow)lb.NamingContainer;
                    if (row != null)
                    {
                        TextBox  S_Time    = row.FindControl("txtstarttime") as TextBox;
                        string   StartTime = S_Time.Text;
                        TextBox  E_Time    = row.FindControl("txtendtime") as TextBox;
                        string   EndTime   = E_Time.Text;
                        CheckBox chk       = (CheckBox)row.FindControl("chkstatus");
                        if (chk.Checked == true)
                        {
                            cbstatus = true;
                        }

                        bool responce = SS.PutEquipmentScheduling(_cmdArg, Convert.ToInt32(ddlObject.SelectedValue), StartTime, EndTime, _days, obs, cbstatus);
                        if (responce == true)
                        {
                            GvdBindObjdetail(Convert.ToInt32(ddlObject.SelectedValue), Convert.ToInt32(ddlDays.SelectedValue));
                            _alert = AlertsClass.SuccessUpdate;
                        }
                    }
                    allowStaticMethods("ALerts('" + _alert + "');staticMethod();");
                }
            }
            catch (Exception)
            { BindingClass.ExceptionAlertScriptManager(this.Page, this.GetType()); }
        }