protected void Page_Load(object sender, EventArgs e) { if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "") { IQCareMsgBox.Show("SessionExpired", this); Response.Redirect("~/frmlogin.aspx", true); } ILabMst LabManager; try { if (!IsPostBack) { //(Master.FindControl("lblRoot") as Label).Text = " » Customize Lists"; //(Master.FindControl("lblMark") as Label).Visible = false; //(Master.FindControl("lblheader") as Label).Text = "Laboratory"; ViewState["TableName"] = Request.QueryString["TableName"].ToString(); ViewState["CategoryId"] = Request.QueryString["CategoryId"].ToString(); ViewState["ListName"] = Request.QueryString["LstName"].ToString(); ViewState["Update"] = Request.QueryString["Upd"].ToString(); ViewState["CCID"] = Request.QueryString["CCID"].ToString(); ViewState["ModuleId"] = Convert.ToInt32(Request.QueryString["ModId"]); (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text = "Customize Lists >> "; (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = "Laboratory"; ViewState["FID"] = Request.QueryString["Fid"].ToString(); LabManager = (ILabMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BLabMst, BusinessProcess.Administration"); //DataSet theDS = LabManager.GetLabs(); DataSet theDS = LabManager.GetLabTestList();//pr_Admin_GetLabTestList_Constella this.grdLab.DataSource = theDS.Tables[0]; this.grdLab.DataBind(); ViewState["gridSortDirection"] = "Desc"; if (ViewState["grdDataSource"] == null) { ViewState["grdDataSource"] = theDS.Tables[0]; } ViewState["SortDirection"] = "Desc"; BindGrid(); AuthenticationManager Authentication = new AuthenticationManager(); if (Authentication.HasFunctionRight(Convert.ToInt32(ViewState["FID"]), FunctionAccess.Add, (DataTable)Session["UserRight"]) == false) { btnAdd.Enabled = false; } } } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theBuilder, this); return; } finally { LabManager = null; } }
protected void Page_Load(object sender, EventArgs e) { if (this.IsPostBack != true) { ViewState["ListName"] = Request.QueryString["LstName"].ToString(); if (Request.QueryString["TableName"] == "PreDefinedDruglist") { DataSet thePharmacyDS = new DataSet(); IPediatric PediatricManager; PediatricManager = (IPediatric)ObjectFactory.CreateInstance("BusinessProcess.Pharmacy.BPediatric, BusinessProcess.Pharmacy"); thePharmacyDS = PediatricManager.GetPediatricFields(1); Session["DrugData"] = thePharmacyDS.Tables[0]; BindList(); } if (Request.QueryString["TableName"] == "PreDefinedLablist") { lblHeader.Text = "Predefined Lab List"; DataSet theLabDS = new DataSet(); ILabFunctions LabManager; LabManager = (ILabFunctions)ObjectFactory.CreateInstance("BusinessProcess.Laboratory.BLabFunctions, BusinessProcess.Laboratory"); theLabDS = LabManager.GetLabs(); Session["DrugData"] = theLabDS.Tables[0]; BindLabList(); } } }
// // GET: /Selection/ //获得实验室选项 public ActionResult getLabs() { List <EasyUISelection> le = new List <EasyUISelection>(); le = new LabManager().getLabSelection(); return(Json(le)); }
public Magazine_Driver(LabManager.LabManager parent, int nMagazine_ID) { _nMagazine_ID = nMagazine_ID; _parent = parent; myMagazineHelper = new MagazineHelper(_nMagazine_ID); string IniFilePath = myDef.LanguageFile; myIniHandler = IniStructure.ReadIni(IniFilePath); // _parent.InsertLoggingEntry((int)Definition.ThorLogWindows.ROUTING, "starting magazine '" + myMagazineHelper.GetMagazineName() + "' "); string strStarting = String.Format(myIniHandler.GetValue("Magazine", "StartMagazineInit"), myMagazineHelper.GetMagazineName()); WriteLoggEntry((int)Definition.ThorLogWindows.ROUTING, strStarting, (int)Definition.Message.D_MESSAGE); UpdateMagazine(); // Hook up the Elapsed event for the timer. MagazineDriverTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent); // Set the Interval to 1 seconds (1000 milliseconds). MagazineDriverTimer.Interval = 1000; MagazineDriverTimer.Enabled = true; if (myMagazineHelper.GetOutputPosition() == -1 || myMagazineHelper.GetMachine_ID() == -1) { string strCorruptConf = String.Format(myIniHandler.GetValue("Magazine", "CorruptConfiguration"), myMagazineHelper.GetOutputPosition(), myMagazineHelper.GetMachine_ID()); WriteLoggEntry((int)Definition.ThorLogWindows.ERROR, strCorruptConf, (int)Definition.Message.D_ALARM); } // Keep the timer alive until the end of Main. //GC.KeepAlive(MagazineDriverTimer); }
protected void Page_Load(object sender, EventArgs e) { if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "") { IQCareMsgBox.Show("SessionExpired", this); Response.Redirect("~/frmlogin.aspx", true); } ILabFunctions LabManager; int PatientID; PatientID = Convert.ToInt32(Session["PatientId"]); try { if (!IsPostBack) { LabManager = (ILabFunctions)ObjectFactory.CreateInstance("BusinessProcess.Laboratory.BLabFunctions, BusinessProcess.Laboratory"); DataSet theDS = (DataSet)LabManager.GetPatientLabOrder(PatientID.ToString()); ViewState["grddata"] = theDS; ViewState["gridSortDirection"] = "Desc"; this.grdLabOrderList.DataSource = theDS.Tables[0].DefaultView; this.grdLabOrderList.DataBind(); BindLaboratoryGrid(); } } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theBuilder, this); return; } }
protected void Page_Load(object sender, EventArgs e) { ILabFunctions LabManager; int PatientID; PatientID = Convert.ToInt32(Request.QueryString["PatientId"]); try { if (!IsPostBack) { LabManager = (ILabFunctions)ObjectFactory.CreateInstance("BusinessProcess.Laboratory.BLabFunctions, BusinessProcess.Laboratory"); DataSet theDS = (DataSet)LabManager.GetPatientLabOrder(PatientID.ToString()); ViewState["grddata"] = theDS; ViewState["gridSortDirection"] = "Desc"; this.grdLabOrderList.DataSource = theDS.Tables[0].DefaultView; this.grdLabOrderList.DataBind(); BindLaboratoryGrid(); } } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theBuilder, this); return; } }
protected void Page_Load(object sender, EventArgs e) { if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "") { IQCareMsgBox.Show("SessionExpired", this); Response.Redirect("~/frmlogin.aspx", true); } if (this.IsPostBack != true) { ViewState["ListName"] = Request.QueryString["LstName"].ToString(); if (Request.QueryString["TableName"] == "PreDefinedDruglist") { DataSet thePharmacyDS = new DataSet(); IPediatric PediatricManager; PediatricManager = (IPediatric)ObjectFactory.CreateInstance("BusinessProcess.Pharmacy.BPediatric, BusinessProcess.Pharmacy"); thePharmacyDS = PediatricManager.GetPediatricFields(1); Session["DrugData"] = thePharmacyDS.Tables[0]; BindList(); } if (Request.QueryString["TableName"] == "PreDefinedLablist") { lblHeader.Text = "Predefined Lab List"; DataSet theLabDS = new DataSet(); ILabFunctions LabManager; LabManager = (ILabFunctions)ObjectFactory.CreateInstance("BusinessProcess.Laboratory.BLabFunctions, BusinessProcess.Laboratory"); theLabDS = LabManager.GetLabs(); Session["DrugData"] = theLabDS.Tables[0]; BindLabList(); } } }
private bool editingAngleField; // bool to check if angle field is being edited // Start is called before the first frame update void Start() { lm = FindObjectOfType <LabManager>(); draggingAngleSlider = false; editingAngleField = false; foreach (Text text in refractionField.GetComponentsInChildren <Text>()) { text.enabled = false; } var indexesOfRefraction = Enum.GetValues(typeof(RefractableMaterial.IndexesOfRefraction)); this.indexesOfRefraction = new List <string>(); foreach (RefractableMaterial.IndexesOfRefraction index in indexesOfRefraction) { this.indexesOfRefraction.Add(index.ToString()); } this.indexesOfRefraction.RemoveAt(this.indexesOfRefraction.Count - 1); indexesMenu.AddOptions(this.indexesOfRefraction); worldIndexesMenu.AddOptions(this.indexesOfRefraction); }
// Start is called before the first frame update void Start() { lab = FindObjectOfType <LabManager>(); vol = lab.acidVolume; vial = FindObjectOfType <Vial>(); resetScale = new Vector3(gameObject.transform.localScale.x, 0, gameObject.transform.localScale.z); gameObject.transform.localScale = resetScale; }
/* * checks if the database contains a row with the same username in the input field */ public IEnumerator CheckUser() { checkingUser = true; username = createUserUsernameField.GetComponent <InputField>().text; password = createUserPasswordField.GetComponent <InputField>().text; // send get request to php script to check username and password string getInstanceURL = "http://69.88.163.18/virtuallaserlab/checkuser.php?"; string get_url = getInstanceURL + "username="******"There was an error checking user: "******"false") { string secretKey = "virtual-laser-lab"; string updateUserURL = "http://69.88.163.18/virtuallaserlab/adduser.php?"; // send hash string hash = LabManager.Md5Sum(username + password + secretKey); // send get request to php script to create account get_url = updateUserURL + "username="******"&password="******"&hash=" + hash; hs_get = UnityWebRequest.Get(get_url); yield return(hs_get.SendWebRequest()); // check for an error if (hs_get.error != null) { Debug.Log("There was an error creating account: " + hs_get.error); } else { validationText.text = "Account created."; } } else { // the user already exists in the database validationText.text = "User already exists."; } } checkingUser = false; }
//获取现有实验室列表 public ActionResult getLabList() { int pageIndex = Request["page"] == null ? 1 : int.Parse(Request["page"]); int pageSize = Request["rows"] == null ? 10 : int.Parse(Request["rows"]); GridData gd = new LabManager().getLabList(pageIndex, pageSize); string s = JsonHelper.JsonDllSerializeEntity <GridData>(gd); return(Content(s)); }
protected void Page_Load(object sender, EventArgs e) { ///////////////////////////////////////////////////////////////////// // Code Written By : Pankaj Kumar // Written Date : 25th July 2006 // Modify Date : Rakhi Tyagi // Modification Date : 22 Feb 2007 // Modify Date : Rupesh Pathak // Modification Date : 19 Nov 2007 // Description : Lab test List // /// ///////////////////////////////////////////////////////////////// ILabMst LabManager; try { if (!IsPostBack) { //(Master.FindControl("lblRoot") as Label).Text = " » Customize Lists"; //(Master.FindControl("lblMark") as Label).Visible = false; //(Master.FindControl("lblheader") as Label).Text = "Laboratory"; (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text = "Customize Lists >> "; (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = "Laboratory"; ViewState["FID"] = Request.QueryString["Fid"].ToString(); LabManager = (ILabMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BLabMst, BusinessProcess.Administration"); //DataSet theDS = LabManager.GetLabs(); DataSet theDS = LabManager.GetLabTestList();//pr_Admin_GetLabTestList_Constella this.grdLab.DataSource = theDS.Tables[0]; this.grdLab.DataBind(); ViewState["gridSortDirection"] = "Desc"; if (ViewState["grdDataSource"] == null) { ViewState["grdDataSource"] = theDS.Tables[0]; } ViewState["SortDirection"] = "Desc"; BindGrid(); AuthenticationManager Authentication = new AuthenticationManager(); if (Authentication.HasFunctionRight(Convert.ToInt32(ViewState["FID"]), FunctionAccess.Add, (DataTable)Session["UserRight"]) == false) { btnAdd.Enabled = false; } } } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theBuilder, this); return; } finally { LabManager = null; } }
protected void Page_Load(object sender, EventArgs e) { //default 0=No : 1=Yes //(Master.FindControl("lblRoot") as Label).Text = "Scheduler"; //(Master.FindControl("lblMark") as Label).Text = ""; //(Master.FindControl("lblMark") as Label).Visible = false; (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text = "Scheduler"; (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = ""; if (Request.QueryString["sts"] != null) { //(Master.FindControl("lblpntStatus") as Label).Text = Request.QueryString["sts"].ToString(); } if (!IsPostBack) { ViewState["a"] = "1"; //---pr_Admin_GetSubTestDetails_Constella , lnk_LabValue rupesh ILabMst LabManager; LabManager = (ILabMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BLabMst, BusinessProcess.Administration"); DataSet theDS = LabManager.GetSubTestDetails(Convert.ToInt32(Request.QueryString["LabId"])); ViewState["MstDS"] = theDS; fillDropDownList(); ddUnit.SelectedIndex = 0; if (((DataSet)ViewState["MstDS"]).Tables[1].Rows.Count > 0) { lblSubTest.Text = ((DataSet)ViewState["MstDS"]).Tables[1].Rows[0][1].ToString(); if (ViewState["grdDataSource"] == null) { ViewState["grdDataSource"] = ((DataSet)ViewState["MstDS"]).Tables[1]; } ViewState["SortDirection"] = "Desc"; grdSearchResult.DataSource = ((DataSet)ViewState["MstDS"]).Tables[1]; BindGrid(); } { //give msg and go to prv page } //RegisterClientScriptBlock("setVisibility('divUnit','divBoundary','divDefault','divButtons', 'none');", ""); //RegisterClientScriptBlock("HideShow();", ""); } else { ViewState["a"] = "2"; } lblSubTest.Text = ((DataSet)ViewState["MstDS"]).Tables[2].Rows[0][0].ToString(); txtUpper.Attributes.Add("onkeyup", "chkNumeric('" + txtUpper.ClientID + "')"); txtLower.Attributes.Add("onkeyup", "chkNumeric('" + txtLower.ClientID + "')"); Page.EnableViewState = true; }
/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> protected void Page_Load(object sender, EventArgs e) { ILabMst LabManager; try { if (!IsPostBack) { (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text = "Customize Lists >> "; (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = "Laboratory"; LabManager = (ILabMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BLabMst, BusinessProcess.Administration"); DataSet theDS = LabManager.GetLabs(); if (Request.QueryString["LabID"] != null) { mainLabId = int.Parse(Request.QueryString["LabID"]); DataView dv = theDS.Tables[0].DefaultView; dv.RowFilter = "LabTestID=" + mainLabId; DataTable theDt = dv.ToTable(); grdLab.DataSource = theDt; H1.InnerText = theDt.Rows[0]["LabName"] + " Parameters"; } else { // string theUrl = string.Format("{0}?Name={1}&Fid={2}", "frmAdmin_LaboratoryTestMaster.aspx", "Add", ViewState["FID"].ToString()); Response.Redirect(theUrl, true); } this.grdLab.DataBind(); ViewState["gridSortDirection"] = "Desc"; ViewState["FID"] = Request.QueryString["Fid"].ToString(); if (ViewState["grdDataSource"] == null) { ViewState["grdDataSource"] = theDS.Tables[0]; } ViewState["SortDirection"] = "Desc"; BindGrid(); } } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theBuilder, this); return; } finally { LabManager = null; } }
private void Awake() { LM = this; m_ReadyTools = new List <GameObject>(); infoPanel = new GameObject(); if (ApplicationManager.AM != null) { AssignTrays(); AssignMissionsToText(); if (m_PrepareButton == null || m_BackButton == null) { Debug.Log("Assign UI buttons to LabManager"); } } }
public void BindLabList() { IQCareUtils theUtils = new IQCareUtils(); BindFunctions theBind = new BindFunctions(); DataView theDV; theDV = new DataView((DataTable)Session["DrugData"]); DataTable theDT = theUtils.CreateTableFromDataView(theDV); if (theDT != null) { DataView theDV1 = new DataView(theDT); theDV1.Sort = "SubTestName"; theDT = theUtils.CreateTableFromDataView(theDV1); } if (theDT != null) { Session["DrugTable"] = theDT; theBind.BindList(lstDrugList, theDT, "SubTestName", "SubTestId"); } DataSet theLabDS = new DataSet(); ILabFunctions LabManager; LabManager = (ILabFunctions)ObjectFactory.CreateInstance("BusinessProcess.Laboratory.BLabFunctions, BusinessProcess.Laboratory"); theLabDS = LabManager.GetPreDefinedLablist(Convert.ToInt32(Session["SystemId"])); if (theLabDS.Tables[0].Rows.Count > 0) { Session["SelectedData"] = theLabDS.Tables[0]; theBind.BindList(lstSelectedDrug, theLabDS.Tables[0], "SubTestName", "SubTestId"); DataTable theDT1 = (DataTable)Session["DrugTable"]; foreach (DataRow r in theLabDS.Tables[0].Rows) { DataRow[] theDR1 = theDT1.Select("SubTestId=" + r[1].ToString()); if (theDR1.Length > 0) { theDT1.Rows.Remove(theDR1[0]); } } Session["DrugTable"] = theDT1; lstDrugList.Items.Clear(); theBind.BindList(lstDrugList, theDT1, "SubTestName", "SubTestId"); } else { Session["SelectedData"] = CreateLabSelectedTable(); } }
/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> protected void Page_Load(object sender, EventArgs e) { if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "") { IQCareMsgBox.Show("SessionExpired", this); Response.Redirect("~/frmlogin.aspx", true); } ILabMst LabManager; try { if (!IsPostBack) { //(Master.FindControl("lblRoot") as Label).Text = " » Customize Lists"; //(Master.FindControl("lblMark") as Label).Visible = false; //(Master.FindControl("lblheader") as Label).Text = "Laboratory"; //(Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text = "Customize Lists >> "; //(Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = "Laboratory"; LabManager = (ILabMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BLabMst, BusinessProcess.Administration"); DataSet theDS = LabManager.GetLabs(); DataView theDV = new DataView(theDS.Tables[0]); theDV.RowFilter = "DataType='Group'"; DataTable theDt = theDV.ToTable(); this.grdLab.DataSource = theDt; this.grdLab.DataBind(); ViewState["gridSortDirection"] = "Desc"; ViewState["FID"] = Request.QueryString["Fid"].ToString(); if (ViewState["grdDataSource"] == null) { ViewState["grdDataSource"] = theDt; } ViewState["SortDirection"] = "Desc"; BindGrid(); } } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theBuilder, this); return; } finally { LabManager = null; } }
//删除实验室 public ActionResult labDel() { MsgBox mb = new MsgBox(); string lab_id = Request["lab_id"] == null ? "" : Request["lab_id"].ToString(); if (!string.IsNullOrEmpty(lab_id)) { mb = new LabManager().labDel(lab_id); } else { mb.status = false; mb.msg = "实验室编号不能为空。"; } return(Json(mb)); }
// private string strActualValue = null; public RoutingCheck(LabManager.LabManager parent) { _parent = parent; // reset all conditions on start and check the routing lines again if connection to WinCC is established string SQL_StatementResetConditions = "UPDATE routing_conditions Set Condition_comply=0"; myHC.return_SQL_Statement(SQL_StatementResetConditions); /* Adds the event and the event handler for the method that will process the timer event to the timer. */ RoutingCeckTimer.Tick += new EventHandler(TimerEventProcessor); // Sets the timer interval to 1 second. RoutingCeckTimer.Interval = 1000; RoutingCeckTimer.Start(); LoadRoutingTable(); }
public RoutingCommand(LabManager.LabManager parent) { _parent = parent; //_parent.InsertLoggingEntry((int)Definition.ThorLogWindows.ROUTING, "starting checking commands for routing... "); WriteLoggEntry((int)Definition.ThorLogWindows.ROUTING, "starting checking commands for routing ... ", (int)Definition.Message.D_MESSAGE); //process the timer event to the timer. CommandTimer.Tick += new EventHandler(TimerEventProcessorForCommands); // Set the timer interval to 1 second! do not change the time otherwise the Count of the TimeForWaning/TimeForAlarm are not correct CommandTimer.Interval = 1000; CommandTimer.Start(); // first check the routing conditions routingCheck = new RoutingCheck(_parent); routingCheck.CheckRoutingTableForActiveConditions(); myHC.ResetActualTimeAndAlarmsOnRoutingPositionEntries(); myHC.WriteWinCCTagFromSampleValuesByValueName("WarningTimeOn", "false", 1); myHC.WriteWinCCTagFromSampleValuesByValueName("AlarmTimeOn", "false", 1); }
/// <summary> /// Fields the validation. /// </summary> /// <returns></returns> private Boolean FieldValidation() { DataTable dtretout = new DataTable(); ICustomList CustomManager; CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList,BusinessProcess.Administration"); if (txtName.Text.Trim() == "") { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["Control"] = lblName.Text; IQCareMsgBox.Show("BlankTextBox", theBuilder, this); txtName.Focus(); return(false); } if (txtSeqNo.Text.Trim() == "" && ddStatus.SelectedValue != "1") { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["Control"] = "Priority"; IQCareMsgBox.Show("BlankTextBox", theBuilder, this); txtSeqNo.Focus(); return(false); } if (txtSeqNo.Text == "0") { IQCareMsgBox.Show("ChkPriority", this); return(false); } if (ViewState["TableName"].ToString() == "Frequency") { if (rdinteger.Checked) { if (txtmultiplier.Text == "") { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["Control"] = "Integer"; IQCareMsgBox.Show("BlankTextBox", theBuilder, this); txtmultiplier.Focus(); return(false); } } } //---- Rupesh---- if ((lblName.Text.ToString().Trim() == "Laboratory Unit :") && (ddStatus.SelectedValue == "1")) { //----check if default value of this Lab Unit is 1 ---- ILabMst LabManager; LabManager = (ILabMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BLabMst, BusinessProcess.Administration"); DataTable theDT = LabManager.CheckDefaultUnit(Convert.ToInt32(ViewState["Id"])); if (theDT.Rows.Count > 0) { if (theDT.Rows[0]["unitID"].ToString() == ViewState["Id"].ToString()) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["Control"] = theDT.Rows[0]["SubTestName"].ToString(); IQCareMsgBox.Show("CannotInactivateUnit", theBuilder, this); ddStatus.Focus(); return(false); } } } return(true); }
private Boolean FieldValidation() { DataTable dtretout = new DataTable(); ICustomList CustomManager; CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList,BusinessProcess.Administration"); if (txtName.Text.Trim() == "") { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["Control"] = lblName.Text; IQCareMsgBox.Show("BlankTextBox", theBuilder, this); txtName.Focus(); return(false); } if (txtSeqNo.Text.Trim() == "" && ddStatus.SelectedValue != "1") { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["Control"] = "Priority"; IQCareMsgBox.Show("BlankTextBox", theBuilder, this); txtSeqNo.Focus(); return(false); } if (txtSeqNo.Text == "0") { IQCareMsgBox.Show("ChkPriority", this); return(false); } if (ViewState["TableName"].ToString() == "Frequency") { if (rdinteger.Checked) { if (txtmultiplier.Text == "") { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["Control"] = "Integer"; IQCareMsgBox.Show("BlankTextBox", theBuilder, this); txtmultiplier.Focus(); return(false); } } } //if (btnSave.Text == "Save") //{ // dtretout = CustomManager.GetDecode(Convert.ToString(ViewState["TableName"]), txtName.Text, 1, 0); //} //else //{ // dtretout = CustomManager.GetDecode(Convert.ToString(ViewState["TableName"]), txtName.Text, 2, Convert.ToInt32(Session["UpdateID"].ToString())); //} //if (dtretout.Rows.Count > 0) //{ // if (dtretout.Rows[0]["Result"].ToString() == "-2") // { // string script = "<script language = 'javascript' defer ='defer' id = 'confirm'>\n"; // script += "var ans=true;\n"; // script += "alert('Name already exists');\n"; // script += "</script>\n"; // RegisterStartupScript("confirm", script); // } // else if (dtretout.Rows[0]["Result"].ToString() == "0") // { // return true; // } // return false; //} //---- Rupesh---- if ((lblName.Text.ToString().Trim() == "Laboratory Unit :") && (ddStatus.SelectedValue == "1")) { //----check if default value of this Lab Unit is 1 ---- ILabMst LabManager; LabManager = (ILabMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BLabMst, BusinessProcess.Administration"); DataTable theDT = LabManager.CheckDefaultUnit(Convert.ToInt32(ViewState["Id"])); if (theDT.Rows.Count > 0) { if (theDT.Rows[0]["unitID"].ToString() == ViewState["Id"].ToString()) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["Control"] = theDT.Rows[0]["SubTestName"].ToString(); IQCareMsgBox.Show("CannotInactivateUnit", theBuilder, this); ddStatus.Focus(); return(false); } } } return(true); }
protected void btnSave_Click(object sender, EventArgs e) { //pr_Admin_SaveLabUnitLinks_Constella if (Validation() == true) { int defUnit = 0; string OldID; ILabMst LabManager; LabManager = (ILabMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BLabMst, BusinessProcess.Administration"); DataSet theDS = (DataSet)ViewState["MstDS"]; //---find ID old Default unitl---- DataView theDV = new DataView(theDS.Tables[1]); theDV.RowFilter = "DefaultUnit='Yes'"; if (theDV.Count > 0) { OldID = theDV[0]["ID"].ToString();//ID of Old Default Unit if ((ddDefault.SelectedIndex == 1) && (txtOperation.Value == "")) { DataTable theDT2 = LabManager.ChangeDefaultUnit(Convert.ToInt32(OldID)); } if (ViewState["SelID"] != null) { if (ViewState["SelID"].ToString() != "") { if ((ddDefault.SelectedIndex == 1) && (ViewState["SelID"].ToString() != OldID)) { DataTable theDT2 = LabManager.ChangeDefaultUnit(Convert.ToInt32(OldID)); } } } } if (ViewState["SelID"] != null) // for add { if (ViewState["SelID"].ToString() != "") { //---edit old unit foreach (DataRow theDR in theDS.Tables[1].Rows) { if (theDR["ID"].ToString() == ViewState["SelID"].ToString()) { theDR["UnitID"] = ddUnit.SelectedValue.ToString(); theDR["UnitName"] = ddUnit.SelectedItem.ToString(); theDR["MinBoundaryValue"] = Convert.ToDecimal(txtLower.Text); theDR["MaxBoundaryValue"] = Convert.ToDecimal(txtUpper.Text); //if (ddDefault.SelectedIndex == 0) // theDR["DefaultUnit"] = "No"; //else // theDR["DefaultUnit"] = "Yes"; // ------- convert previous default unit to "No"---- if ((ddDefault.SelectedIndex == 0) & (theDS.Tables[1].Rows.Count >= 0)) { theDR["DefaultUnit"] = "No"; defUnit = 0; } else { theDR["DefaultUnit"] = "Yes"; defUnit = 1; } DataTable theDT2 = LabManager.SaveLabUnitLinks(Convert.ToInt32(ViewState["SelID"]), Convert.ToInt32(theDS.Tables[1].Rows[0][0]), Convert.ToDecimal(txtLower.Text), Convert.ToDecimal(txtUpper.Text), Convert.ToInt32(ddUnit.SelectedValue), defUnit); break; } } } } if ((ViewState["SelID"] == null))//for edit { //---add new unit DataRow theDR = theDS.Tables[1].NewRow(); //theDR["SubTestID"] = theDS.Tables[1].Rows[0][0];//Request.QueryString["LabId"] theDR["SubTestID"] = Request.QueryString["LabId"]; theDR["SubTestName"] = lblSubTest.Text.ToString(); theDR["UnitID"] = ddUnit.SelectedValue.ToString(); theDR["UnitName"] = ddUnit.SelectedItem.ToString(); theDR["MinBoundaryValue"] = Convert.ToDecimal(txtLower.Text); theDR["MaxBoundaryValue"] = Convert.ToDecimal(txtUpper.Text); //---first unit should be "Yes" by default----- if ((ddDefault.SelectedIndex == 0) & (theDS.Tables[1].Rows.Count >= 0)) { theDR["DefaultUnit"] = "No"; defUnit = 0; } else { theDR["DefaultUnit"] = "Yes"; defUnit = 1; } theDS.Tables[1].Rows.Add(theDR); DataTable theDT2 = LabManager.SaveLabUnitLinks(99999, Convert.ToInt32(theDS.Tables[1].Rows[0][0]), Convert.ToDecimal(txtLower.Text), Convert.ToDecimal(txtUpper.Text), Convert.ToInt32(ddUnit.SelectedValue), defUnit); } //--again get saved values from database) LabManager = (ILabMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BLabMst, BusinessProcess.Administration"); theDS = LabManager.GetSubTestDetails(Convert.ToInt32(Request.QueryString["LabId"])); ViewState["MstDS"] = theDS; grdSearchResult.Columns.Clear(); grdSearchResult.DataSource = ((DataSet)ViewState["MstDS"]).Tables[1]; BindGrid(); ViewState["SelID"] = null; ViewState["a"] = 1; txtLower.Text = ""; txtUpper.Text = ""; ddDefault.SelectedIndex = 0; ddUnit.Enabled = true; ddUnit.SelectedIndex = 0; ViewState["grdDataSource"] = ((DataSet)ViewState["MstDS"]).Tables[1]; ViewState["SortDirection"] = "Desc"; txtOperation.Value = "";// 11Jan08 -- it was creating duplicate default unit string theUrl; if (Request.QueryString["name"] == "Add") { theUrl = "frmAdmin_LabTestBoundary.aspx?name=Add"; } else { theUrl = string.Format("{0}LabId={1}", "frmAdmin_LabTestBoundary.aspx?name=" + "Edit" + "&", Request.QueryString["LabId"].ToString()); } Response.Redirect(theUrl); } int a = 2; }
// initialize fields void Start() { lr = GetComponent <LineRenderer>(); lm = FindObjectOfType <LabManager>(); }
public TCPIPHelper( LabManager.LabManager parent) { this.parent = parent; }
//protected void Page_Init(object sender, EventArgs e) //{ // /***************** Check For User Rights ****************/ // AuthenticationManager Authentiaction = new AuthenticationManager(); // if (Authentiaction.HasFunctionRight(ApplicationAccess.Schedular, FunctionAccess.Update, (DataTable)Session["UserRight"]) == false) // { // //btnSubmit.Enabled = false; // //btnNewAppointment.Enabled = false; // } // if (Authentiaction.HasFunctionRight(ApplicationAccess.Schedular, FunctionAccess.Add, (DataTable)Session["UserRight"]) == false) // { // // btnSubmit.Enabled = false; // //btnNewAppointment.Enabled = false; // } //} protected void Page_Load(object sender, EventArgs e) { if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "") { IQCareMsgBox.Show("SessionExpired", this); Response.Redirect("~/frmlogin.aspx", true); } if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "") { IQCareMsgBox.Show("SessionExpired", this); Response.Redirect("~/frmlogin.aspx", true); } (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text = "Scheduler"; (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = ""; if (Request.QueryString["Fid"] != null) { ViewState["FID"] = Request.QueryString["Fid"].ToString(); } if (Request.QueryString["sts"] != null) { //(Master.FindControl("lblpntStatus") as Label).Text = Request.QueryString["sts"].ToString(); } if (!IsPostBack) { ViewState["a"] = "1"; //---pr_Admin_GetSubTestDetails_Constella , lnk_LabValue rupesh ILabMst LabManager; LabManager = (ILabMst)ObjectFactory.CreateInstance("BusinessProcess.Administration.BLabMst, BusinessProcess.Administration"); DataSet theDS = LabManager.GetSubTestDetails(Convert.ToInt32(Request.QueryString["LabId"])); ViewState["MstDS"] = theDS; fillDropDownList(); ddUnit.SelectedIndex = 0; if (((DataSet)ViewState["MstDS"]).Tables[1].Rows.Count > 0) { lblSubTest.Text = ((DataSet)ViewState["MstDS"]).Tables[1].Rows[0][1].ToString(); if (ViewState["grdDataSource"] == null) { ViewState["grdDataSource"] = ((DataSet)ViewState["MstDS"]).Tables[1]; } ViewState["SortDirection"] = "Desc"; grdSearchResult.DataSource = ((DataSet)ViewState["MstDS"]).Tables[1]; BindGrid(); } { //give msg and go to prv page } //RegisterClientScriptBlock("setVisibility('divUnit','divBoundary','divDefault','divButtons', 'none');", ""); //RegisterClientScriptBlock("HideShow();", ""); } else { ViewState["a"] = "2"; } lblSubTest.Text = ((DataSet)ViewState["MstDS"]).Tables[2].Rows[0][0].ToString(); txtUpper.Attributes.Add("onkeyup", "chkNumeric('" + txtUpper.ClientID + "')"); txtLower.Attributes.Add("onkeyup", "chkNumeric('" + txtLower.ClientID + "')"); Page.EnableViewState = true; AuthenticationManager Authentication = new AuthenticationManager(); if (Authentication.HasFunctionRight(Convert.ToInt32(ViewState["FID"]), FunctionAccess.Update, (DataTable)Session["UserRight"]) == false) { btnSave.Enabled = false; } }