public static string[] Ajax(string Param1, string Param2) { int cv_no; Int32.TryParse(Param1, out cv_no); string LR = Param2 == LEFT ? "L" : "R"; WorkerDB db = new WorkerDB(); Respon resp = db.CheckWorkPosition(cv_no, LR); if (resp.Heat_no == 0) { resp.Heat_no = db.GetCurrentHeat(cv_no); } string[] msg = { resp.Heat_no.ToString(), resp.Info ?? "фурма не в работе" }; return(msg); }
protected void Page_Init(object sender, EventArgs e) { BR br = new WorkerDB().GetHandBK(); DL_Reasons.DataSource = br.Reason; DL_Reasons.DataBind(); DL_Jobs.DataSource = br.Jobs; DL_Jobs.DataBind(); SaveEditButton.Click += delegate { Lance lance = GetObjectFromControls <Lance>(EditTableDiv.Controls); lance.DateInstall = Request.Form[DATE_INSTALL]; lance.DateDeinstall = Request.Form[DATE_DEINSTALL]; Page.ClientScript.RegisterHiddenField(DATE_INSTALL + "_hidden", lance.DateInstall); Page.ClientScript.RegisterHiddenField(DATE_DEINSTALL + "_hidden", lance.DateDeinstall); string key = mark + Lance_num; DataInsertCache(key, lance); AddKey(key, keys_collection); new WorkerDB().DataInsertDB(lance); Response.Redirect("~/lances/" + Lance_num); }; }