//verify if the deviation is closed public bool isDeviationClosed(Deviation deviation) { if (deviation.status == "closed") { return(true); } else { return(false); } }
/// <summary> /// 新增 /// </summary> public override int EntityAdd() { DeviationRule rule = new DeviationRule(); Deviation entity = EntityGet(); DeviationDts[] entitydts = EntityDtsGet(); entity.SubmitFlag = this.HTSubmitFlagInsertGet(); rule.RAdd(entity, entitydts); return(entity.ID); }
public static float getRule25() { float uDe = Deviation.uFR(de); float uDi = Distance.uN(di); float uDf = Deviation.uFR(df); float a = Mathf.Min(uDe, Mathf.Min(uDi, uDf)); float b = uDe * uDi * uDf; burning += b; return(b * Steerage.hardLeft(a)); }
public static float getRule03() { float uDe = Deviation.uFL(de); float uDi = Distance.uN(di); float uDf = Deviation.uM(df); float a = Mathf.Min(uDe, Mathf.Min(uDi, uDf)); float b = uDe * uDi * uDf; burning += b; return(b * Steerage.straight(a)); }
/****************** update Deviation ****************/ public void updateDeviation(Deviation deviation) { using (var session = NHibernateHelper.OpenSession()) { using (var transaction = session.BeginTransaction()) { session.Merge(deviation); transaction.Commit(); } } }
public static float getRule08() { float uDi = Distance.uF(di); float uDe = Deviation.uR(de); float b = uDi * uDe; float a = Mathf.Min(uDi, uDe); float r1 = (1f + a) / 3.33f; float r2 = (4f - a) / 5f; sumBurning += b; return(b * (r1 + r2) / 2f); }
public static float getRule06() { float uDi = Distance.uF(di); float uDe = Deviation.uM(de); float b = uDi * uDe; float a = Mathf.Min(uDi, uDe); float r1 = (3.5f + a) / 5f; float r2 = 1f; sumBurning += b; return(b * (r1 + r2) / 2f); }
public EmailGUI(Deviation deviation, SaveDeviation saveDeviation) { InitializeComponent(); this.deviation = deviation; this.saveDeviation = saveDeviation; this.deviationModel = new DeviationModel(); emailSender = new EmailSender(); languageModel = new LanguageModel(); //generate email Content from deviation this.generateEmailContent(); }
/***************** reject Deviation ************/ public void rejectDeviation(Deviation deviation) { using (var session = NHibernateHelper.OpenSession()) { using (var transaction = session.BeginTransaction()) { deviation.status = "rejected"; session.Merge(deviation); transaction.Commit(); } } }
public static float getRule10() { float uDi = Distance.uF(di); float uDe = Deviation.uFR(de); float b = uDi * uDe; float a = Mathf.Min(uDi, uDe); float r1 = (a + 0.11f) / 4.44f; float r2 = (2f - a) / 4f; sumBurning += b; return(b * (r1 + r2) / 2f); }
/****************** If the Deviation is printed ****************/ public void setIsPrintedDeviation(Deviation deviation) { using (var session = NHibernateHelper.OpenSession()) { using (var transaction = session.BeginTransaction()) { deviation.isPrinted = true; session.Merge(deviation); transaction.Commit(); } } }
public static float getRule04() { float uTimeL = LightStatus.uG(timeL); float uDe = Deviation.uFL(de); float b = uTimeL * uDe; float a = Mathf.Min(uTimeL, uDe); float r1 = (a + 0.11f) / 4.44f; float r2 = (2f - a) / 4f; sumBurning += b; return(b * (r1 + r2) / 2f); }
public static float getRule03() { float uTimeL = LightStatus.uG(timeL); float uDe = Deviation.uR(de); float b = uTimeL * uDe; float a = Mathf.Min(uTimeL, uDe); float r1 = (a + 1f) / 3.33f; float r2 = (4f - a) / 5f; sumBurning += b; return(b * (r1 + r2) / 2f); }
//add the page foot private PdfPTable addPageFoot(Deviation deviation) { PdfPTable table = new PdfPTable(3); table.WidthPercentage = 100; this.addTableCellForPageFoot(table, "Erstellt:A.Manow", small, 1, 0); this.addTableCellForPageFoot(table, "Ausgabe D / 20.01.2016", small, 1, 0); this.addTableCellForPageFoot(table, deviation.deviationRef, small, 1, 2); return(table); }
public int Insert_DeviationMaster(ref Deviation Entity_Call, int LOCID, out string strError) { int iInsert = 0; strError = string.Empty; try { SqlParameter pAction = new SqlParameter(Deviation._Action, SqlDbType.BigInt); SqlParameter pDeviationNo = new SqlParameter(Deviation._DeviationNo, SqlDbType.NVarChar); SqlParameter pCreatedBy = new SqlParameter(Deviation._LoginID, SqlDbType.BigInt); SqlParameter pCreatedDate = new SqlParameter(Deviation._LoginDate, SqlDbType.DateTime); SqlParameter pDeviationFrom = new SqlParameter(Deviation._DeviationFrom, SqlDbType.DateTime); SqlParameter pDeviationTo = new SqlParameter(Deviation._DeviationTo, SqlDbType.DateTime); SqlParameter pSysAmt = new SqlParameter(Deviation._SysAmt, SqlDbType.Decimal); SqlParameter pPhyAmt = new SqlParameter(Deviation._PhyAmt, SqlDbType.Decimal); SqlParameter pLOCID = new SqlParameter("@LOCID", SqlDbType.BigInt); pAction.Value = 3; pDeviationNo.Value = Entity_Call.DeviationNo; pCreatedBy.Value = Entity_Call.LoginID; pCreatedDate.Value = Entity_Call.LoginDate; pDeviationFrom.Value = Entity_Call.DeviationFrom; pDeviationTo.Value = Entity_Call.DeviationTo; pSysAmt.Value = Entity_Call.SysAmt; pPhyAmt.Value = Entity_Call.PhyAmt; pLOCID.Value = LOCID; SqlParameter[] Param = new SqlParameter[] { pAction, pDeviationNo, pCreatedBy, pCreatedDate, pDeviationFrom, pDeviationTo, pSysAmt, pPhyAmt, pLOCID }; Open(CONNECTION_STRING); BeginTransaction(); iInsert = SQLHelper.ExecuteScalar(_Connection, _Transaction, CommandType.StoredProcedure, Deviation.SP_Deviation, Param); if (iInsert > 0) { CommitTransaction(); } else { RollBackTransaction(); } } catch (Exception ex) { RollBackTransaction(); strError = ex.Message; } finally { Close(); } return(iInsert); }
/****************** add Derivation ******************************/ public Deviation addDeviation(Deviation deviation) { using (var session = NHibernateHelper.OpenSession()) { using (var transaction = session.BeginTransaction()) { session.Save(deviation); transaction.Commit(); } } return(deviation); }
/// <summary> /// Sets the signal deviation according to the given parameters /// </summary> /// <param name="deviation">Fm Deviation</param> /// <param name="typeHz">Dimension type</param> public void SetFmDeviation(double deviation, Deviation typeHz) { try { _deviceExchanger.SendRequestDataString(":FM:DEV " + deviation + " " + typeHz + ";"); } catch (Smb100AException smb100AException) { throw new Smb100AException("Failed to set signal deviation value to " + deviation + " " + typeHz + ": " + smb100AException.Message); } }
public void PostDeviation_should_add_a_deviation_to_the_repository() { // Arrange // Act _controllerUndertest.PostDeviation(new[] { TestData.BuildTestDeviation(TestData.TEST_REPORTER_NAME) }); // Assert Deviation deviationFromDb = _db.Deviations.FindByReporter(TestData.TEST_REPORTER_NAME); deviationFromDb.Should().Not.Be.Null(); deviationFromDb.Reporter.Should().Equal(TestData.TEST_REPORTER_NAME); }
public static float getRule37() { float uTimeL = LightStatus.uLR(timeL); float uDi = Distance.uM(di); float uDe = Deviation.uFR(de); float b = uTimeL * uDi * uDe; float a = Mathf.Min(uTimeL, Mathf.Min(uDi, uDe)); float r1 = (0.11f + a) / 4.44f; float r2 = (2f - a) / 4f; sumBurning += b; return(b * (r1 + r2) / 2f); }
public static float getRule32() { float uTimeL = LightStatus.uLG(timeL); float uDi = Distance.uN(di); float uDe = Deviation.uFR(de); float b = uTimeL * uDi * uDe; float a = Mathf.Min(uTimeL, Mathf.Min(uDi, uDe)); float r1 = 0f; float r2 = (1f - a) / 20f; sumBurning += b; return(b * (r1 + r2) / 2f); }
public static float getRule25() { float uTimeL = LightStatus.uLG(timeL); float uDi = Distance.uM(di); float uDe = Deviation.uR(de); float b = uTimeL * uDi * uDe; float a = Mathf.Min(uTimeL, Mathf.Min(uDi, uDe)); float r1 = (a + 1f) / 3.33f; float r2 = (4f - a) / 5f; sumBurning += b; return(b * (r1 + r2) / 2f); }
//the USER cann update the Deviation if he WROTE IT: output: null if must not, Deviation object if is allowed public Deviation canUpdateDeviation(String deviationRef) { Deviation deviation = deviationModel.getDeviationWithRef(deviationRef); if (deviation.signature == deviationModel.getUserNameFromActiveDirectory()) { return(deviation); } else { return(null); } }
public void EvaluateApproach(Approach approach) { this.deviationObserver.RemoveDeviation(DeviationMessageConstants.APPR_ESA_REQUIRED_KEY); bool hasEsa = this.approachService.HasEsa(approach.Id); if (approach.Criteria.Value == CriteriaType.NATO && !hasEsa) { Deviation deviation = this.deviationFactory.CreateDeviation( DeviationMessageConstants.APPR_ESA_REQUIRED_FOR_NATO, DeviationMessageConstants.APPR_ESA_REQUIRED_FOR_NATO_SEVERITY); deviationObserver.PublishDeviation(DeviationMessageConstants.APPR_ESA_REQUIRED_KEY, deviation); } }
/// <summary> /// 新增 /// </summary> /// <param name="p_Entity">实体类</param> /// <returns>操作影响的记录行数</returns> public override int AddNew(BaseEntity p_Entity) { try { Deviation MasterEntity = (Deviation)p_Entity; if (MasterEntity.ID == 0) { return(0); } //新增主表数据 StringBuilder MasterField = new StringBuilder(); StringBuilder MasterValue = new StringBuilder(); MasterField.Append("INSERT INTO Data_Deviation("); MasterValue.Append(" VALUES("); MasterField.Append("ID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.ID) + ","); MasterField.Append("Code" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.Code) + ","); MasterField.Append("Name" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.Name) + ","); MasterField.Append("Remark" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.Remark) + ","); MasterField.Append("DelFlag" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.DelFlag) + ","); MasterField.Append("SubmitFlag" + ")"); MasterValue.Append(SysString.ToDBString(MasterEntity.SubmitFlag) + ")"); //执行 int AffectedRows = 0; if (!this.sqlTransFlag) { AffectedRows = this.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString()); } else { AffectedRows = sqlTrans.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString()); } return(AffectedRows); } catch (BaseException E) { throw new BaseException(E.Message, E); } catch (Exception E) { throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBInsert), E); } }
protected void GrdReport_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.DataRow) { SystemOpening += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "SystemOpening")); ActualOpening += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "ActualOpening")); Purchase += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Purchase")); Sales += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Sales")); SalesReturn += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "SalesReturn")); Inward += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Inward")); Outward += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Outward")); OutwardReturn += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "OutwardReturn")); TransferIN += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "TransferIN")); TransferOUT += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "TransferOUT")); Damaged += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Damage")); PurReturn += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "ReturnToSupplier")); Deviation += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Deviation")); SystemClosing += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "SystemClosing")); ActualClosing += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "ActualClosing")); SystemAmount += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "SystemAmount")); ActualAmount += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "ActualAmount")); } if (e.Row.RowType == DataControlRowType.Footer) { e.Row.Cells[6].Text = "Total"; e.Row.Cells[7].Text = SystemOpening.ToString("0.00"); e.Row.Cells[8].Text = ActualOpening.ToString("0.00"); e.Row.Cells[9].Text = Purchase.ToString("0.00"); e.Row.Cells[11].Text = Sales.ToString("0.00"); e.Row.Cells[12].Text = SalesReturn.ToString("0.00"); e.Row.Cells[13].Text = Inward.ToString("0.00"); e.Row.Cells[14].Text = Outward.ToString("0.00"); e.Row.Cells[15].Text = OutwardReturn.ToString("0.00"); e.Row.Cells[16].Text = TransferIN.ToString("0.00"); e.Row.Cells[17].Text = TransferOUT.ToString("0.00"); e.Row.Cells[18].Text = Damaged.ToString("0.00"); e.Row.Cells[10].Text = PurReturn.ToString("0.00"); e.Row.Cells[19].Text = Deviation.ToString("0.00"); e.Row.Cells[20].Text = SystemClosing.ToString("0.00"); e.Row.Cells[21].Text = ActualClosing.ToString("0.00"); e.Row.Cells[22].Text = SystemAmount.ToString("0.00"); e.Row.Cells[23].Text = ActualAmount.ToString("0.00"); } } catch (Exception ex) { } }
/// <summary> /// 获得实体 /// </summary> /// <returns></returns> private Deviation EntityGet() { Deviation entity = new Deviation(); entity.ID = HTDataID; entity.SelectByID(); entity.Code = txtCode.Text.Trim(); entity.Name = txtName.Text.Trim(); entity.Remark = txtRemark.Text.Trim(); return(entity); }
//Отклонение среднего значения от стартового среднего для прослеживания дианмики public async Task <Deviation> GetDeviations(int productId) { var firstAvgValues = await _testerUserService.GetAvgOfFirstIndicatorValues(productId); var averageValues = await GetAvarageValuesForEachParameter(productId); var response = new Deviation(); response.BloodPressure = averageValues.BloodPressure - firstAvgValues.BloodPressure; response.BloodOxygenLevel = averageValues.BloodOxygenLevel - firstAvgValues.BloodOxygenLevel; response.Pulse = averageValues.Pulse - firstAvgValues.Pulse; response.Temperature = averageValues.Temperature - firstAvgValues.Temperature; return(response); }
//show deviation public void showDeviation(Deviation deviation) { this.updateDeviation(deviation); this.deviationSignature.Enabled = false; this.deviationNO.Enabled = false; this.approvementGroupDataGrid.AllowUserToAddRows = false; this.addDocument.Enabled = false; this.deleteDocument.Enabled = false; this.DeviationSave.Enabled = false; this.closeDeviation.Enabled = false; this.deviation = deviation; this.Show(); }
//get Approvement Group who did not approved private List <String> getGroupsEmailNotApproved(Deviation deviation) { List <String> groupsEmail = new List <String>(); var approvements = deviation.approvements; foreach (var approvement in approvements) { if (approvement.name == "" || approvement.name == null) { groupsEmail.Add(approvement.approvementGroup.groupEmail); } } return(groupsEmail.Distinct().ToList()); }
protected void BtnSave_Click(object sender, EventArgs e) { int InsertRow = 0, InsertRowDtls = 0; try { Entity_Deviation.DeviationNo = ""; Entity_Deviation.LoginID = Convert.ToInt32(Session["UserId"]); Entity_Deviation.LoginDate = Convert.ToDateTime(DateTime.Now.ToShortDateString()); Entity_Deviation.DeviationFrom = Convert.ToDateTime(txtFromDate.Text); Entity_Deviation.DeviationTo = Convert.ToDateTime(txtToDate.Text); Entity_Deviation.SysAmt = Convert.ToDecimal(TxtSysamount.Text); Entity_Deviation.PhyAmt = Convert.ToDecimal(TxtPhyamount.Text); InsertRow = Obj_Deviation.Insert_DeviationMaster(ref Entity_Deviation, Convert.ToInt32(Session["CafeteriaId"].ToString()), out StrError); if (InsertRow > 0) { if (DeviationGrid.Rows.Count > 0) { DataTable dtInsert = new DataTable(); for (int i = 0; i < DeviationGrid.Rows.Count; i++) { Entity_Deviation.DeviationID = InsertRow; Entity_Deviation.ItemID = Convert.ToInt32(((Label)DeviationGrid.Rows[i].FindControl("LblProcessId")).Text); Entity_Deviation.UnitID = Convert.ToInt32(DeviationGrid.Rows[i].Cells[5].Text); Entity_Deviation.Rate = Convert.ToDecimal(DeviationGrid.Rows[i].Cells[7].Text); Entity_Deviation.LocationID = Convert.ToInt32(DeviationGrid.Rows[i].Cells[8].Text); Entity_Deviation.SysClosing = Convert.ToDecimal(((TextBox)DeviationGrid.Rows[i].FindControl("GrtxtSysClosing")).Text); Entity_Deviation.PhyClosing = Convert.ToDecimal(((TextBox)DeviationGrid.Rows[i].FindControl("GrtxtPhyClosing")).Text); Entity_Deviation.Deviation1 = (Convert.ToDecimal(((TextBox)DeviationGrid.Rows[i].FindControl("GrtxtSysClosing")).Text) - Convert.ToDecimal(((TextBox)DeviationGrid.Rows[i].FindControl("GrtxtPhyClosing")).Text)); //Convert.ToDecimal(((Label)DeviationGrid.Rows[i].FindControl("Deviation")).Text); Entity_Deviation.PhyRate = Convert.ToDecimal(((TextBox)DeviationGrid.Rows[i].FindControl("GrtxtPhyRate")).Text); InsertRowDtls = Obj_Deviation.Insert_DeviationDetails(ref Entity_Deviation, out StrError); } } } if (InsertRow > 0) { obj_Comman.ShowPopUpMsg("Record Saved Successfully", this.Page); MakeEmptyForm(); Entity_Deviation = null; Obj_Deviation = null; } } catch (Exception ex) { throw new Exception(ex.Message); } }