protected void Page_Load(object sender, EventArgs e) { try { cmdAdd.Attributes.Add("OnClick", "return fn_ManipulateAllergy();"); cmdClear.Attributes.Add("OnClick", "return fn_CancelAllergyDetails();"); cmdSave.Attributes.Add("OnClick", "glbCtrlClicked='Save';"); cmdReset.Attributes.Add("OnClick", "glbCtrlClicked='Reset';"); Page.ClientScript.RegisterOnSubmitStatement(Page.GetType(), "OnSubmit", "return fn_ValidateScreen();"); chkInactive.Attributes.Add("onclick", "return fn_Inactive();"); AddClientOnLoadScript("fn_Inactive();"); hdnJurisId.Value = Request.QueryString.Get("hdnJurisID") == null ? string.Empty : Request.QueryString.Get("hdnJurisID").Trim().ToString(); hdnBookingID.Value = Request.QueryString.Get("BookingID") == null ? string.Empty : Request.QueryString.Get("BookingID").ToString(); if (Request.QueryString.Get("Mode") != null && Request.QueryString.Get("Mode") != string.Empty) //CRM#65266 All inmate Booking Status should allow to create Medical Entry { hdnMode.Value = Request.QueryString.Get("Mode").ToString(); } if (!IsPostBack) { BoundCheckBoxField ChkColumn = (BoundCheckBoxField)this.grdAllergy.Columns.FromKey("Isactive"); ChkColumn.ValueConverter = new BoolConverter(); JMMAllergy objJMMAllergy = new JMMAllergy(); if (!String.IsNullOrEmpty(hdnJurisId.Value)) { objJMMAllergy.JurisID = KPIHlp.CVI32(hdnJurisId.Value); } if (!String.IsNullOrEmpty(hdnBookingID.Value)) { objJMMAllergy.JMBookingID = KPIHlp.CVI64(hdnBookingID.Value); Inquiry(ref objJMMAllergy); } } if (KPIHlp.CVI32(hdnJurisId.Value) > 0) { hdnSetUserPFID.Value = State.GPV((int)JailAdmissionParams.IsDefaultAllPFFields, KPIHlp.CVI32(hdnJurisId.Value)); } if (hdnJurisId.Value == KPIHlp.CVS(State.sJurisID)) { hdnLoginPFCode.Value = KPI.Global.Helper.PersonnelHlp.GetPFCode(State.sPFID); hdnLoginPFDesc.Value = KPI.Global.Helper.PersonnelHlp.GetPFFullName(State.sPFID); hdnLoginPFID.Value = State.sPFID.ToString(); } } catch (Exception) { KPITrace.Debug(TraceWeight.Five, "Calling page load for medical Allergy screen"); WrtActivityLog(long.MinValue, " Calling page load for medical Allergy screen."); } }
protected void Page_Load(object sender, System.EventArgs e) { try { //SetFocus((WebControl) txtBuildingName); cmdSearch.Attributes.Add("OnClick", "return ValidateScrn();"); BoundCheckBoxField ChkDentist = (BoundCheckBoxField)this.grdDoctorSrch.Columns.FromKey("Dentist"); ChkDentist.ValueConverter = new BoolConverter(); BoundCheckBoxField ChkInactive = (BoundCheckBoxField)this.grdDoctorSrch.Columns.FromKey("Inactive"); ChkInactive.ValueConverter = new BoolConverter(); #region Added By Jothiraj for load the grid intially Based on the screen height if (Request.QueryString.Get("ScreenHeight") != null && !String.IsNullOrEmpty(Request.QueryString.Get("ScreenHeight"))) { string height = Request.QueryString.Get("ScreenHeight"); if (height.Contains(",")) { height = height.Split(',')[0]; } hdnPageHgt.Value = height; if (!String.IsNullOrEmpty(hdnPageHgt.Value)) { string grdHeight = string.Format("{0}px", KPIHlp.CVI32(hdnPageHgt.Value) - 300); grdDoctorSrch.Style.Add("height", grdHeight); } } iGrdPageSize = GrdPageSize(this.Page, 260); #endregion Added By Jothiraj for load the grid intially Based on the screen height switch (hdnAutoLoad.Value) { case "LOAD": RetrieveDoctorSrch(); break; } hdnAutoLoad.Value = ""; if (!Page.IsPostBack) { AddClientOnLoadScript("setFocusOnDoctorName()"); } } catch (KPIException objKPIError) { ShowMsg(MsgType.Error, FrwkMsg.ERR, objKPIError); } catch (Exception objErr) { ShowMsg(MsgType.Error, FrwkMsg.PAGE_ERR, objErr); } }
//添加参数,定义是否列是否可编辑 public void AddCheckBoxColumn(string key, string text, bool isreadonly, int width) { if (!this.dtSource.Columns.Contains(key)) { this.dtSource.Columns.Add(key, typeof(bool)); this.dtSource.AcceptChanges(); } if (this.Grid.Columns.FromKey(key) != null) { return; } //UnboundCheckBoxField col = new UnboundCheckBoxField(); BoundCheckBoxField col = new BoundCheckBoxField(); col.Key = key; if (width > 0) { col.Width = new System.Web.UI.WebControls.Unit(width); } else { col.Width = new System.Web.UI.WebControls.Unit(30); } col.Header.Text = text; //设置水平位置 col.CssClass = HorizontalAlign.Center.ToString(); col.Header.CssClass = HorizontalAlign.Center.ToString(); this.Grid.Columns.Add(col); //checkbox列不需要排序 SortingColumnSetting sortColSet = new SortingColumnSetting(this.Grid); sortColSet.ColumnKey = key; sortColSet.Sortable = false; this.Grid.Behaviors.CreateBehavior <Sorting>().ColumnSettings.Add(sortColSet); EditingColumnSetting checkCol = new EditingColumnSetting(this.Grid); checkCol.ColumnKey = key; checkCol.ReadOnly = isreadonly; this.Grid.Behaviors.CreateBehavior <EditingCore>().Behaviors.CreateBehavior <CellEditing>().ColumnSettings.Add(checkCol); }