public WMException CreateExternalDesign(Design design) { WMException WMexcept = null; /////////////////// ////get the next Oracle WE_S_SO_EXTDSG ExtDesignKey key = new ExtDesignKey() { TsExtDsgn = DateTime.Now, IdOper = design.IDOper }; // TODO: Add an insert to the design table // twmDesignRepository.Insert(null); /////////////////// ////insert Points// new PointBl().CreateExternalDesign(design, design.Points, key); /////////////////////// ////insert CUs /FAC's// CreateCUsFacilityAttributes(design, key); /////////////////// ////call P Driver// WMexcept = ExecutePDriver(design, key); return(WMexcept); }
public WMException CreateExternalDesignFromIf(IFExtDsgnPoint twmifextdsgn_pt_obj, bool finished, DateTime timeofcreate, string oper, string asbOrEstInd) { WMException WMexcept = null; /////////////////// ////get the next Oracle WE_S_SO_EXTDSG ExtDesignKey key = new ExtDesignKey() { TsExtDsgn = timeofcreate, IdOper = oper }; // ExtDesignKey key = new ExtDesignKey() { TsExtDsgn = twmifextdsgn_pt_obj.ExternalDesignTimeStamp, IdOper = twmifextdsgn_pt_obj.OperatorId }; /////////////////// ////insert Points// // new PointBl().CreateExternalDesign(design, design.Points, key); /////////////////////// ////insert CUs /FAC's// // CreateCUsFacilityAttributes(design, key); CreateExternalDesignIf(twmifextdsgn_pt_obj, key); /////////////////// ////call P Driver// // WMexcept = ExecutePDriver(twmifextdsgn_pt_obj, key); return(WMexcept); }
public CU TransformToCU(string workRequestId, ExtDesignKey key, string PointNumber, string PointSpanNumber, decimal?quanity, UnitDetail obj) { CU cu = new CU(); cu.WorkRequest = workRequestId; cu.UnitAction = obj.IND_ACTION; cu.Account = obj.IND_ACCT; cu.UnitCode = obj.Name; //cu.MUID = obj. //cu.DesignNumber = cu.PointNumber = PointNumber; cu.PointSpanNumber = PointSpanNumber; cu.Usage = obj.CD_USAGE; cu.OnOff = "N"; cu.EquipNumber = ""; cu.SupplyMethod = ""; cu.Quantity = quanity.ToString(); //cu.CrewClass = cu.UnitDetail = null; cu.CUFacilityAttributes = null; cu.LaborDetails = null; return(cu); }
private void CreateCUsFacilityAttributes(Design design, ExtDesignKey key) { foreach (Point p in design.Points) { new CUBl().CreateExternalDesign(design.District, p.CUs, key); } }
private void CreateFacilityAttributes(IFExtDsgnCU cup, ExtDesignKey key) { if (cup.IfExtDsgnFacAtt != null && cup.IfExtDsgnFacAtt.Count > 0) { foreach (IFExtDsgnFacAtt fa in cup.IfExtDsgnFacAtt) { unitOfWork.IfExtDesignFacRepo.Insert(MapObjectToFacIfEntity(fa, key)); unitOfWork.Save(); } } }
private void CreateFacilityAttributes(CU cup, ExtDesignKey key) { if (cup.CUFacilityAttributes != null && cup.CUFacilityAttributes.Count > 0) { foreach (CUFacilityAttribute fa in cup.CUFacilityAttributes) { unitOfWork.IfExtDesignFacRepo.Insert(MapObjectToIfEntity(fa, key)); unitOfWork.Save(); } } }
public TWMIFEXTDSGN_CU MapObjectToIfEntity(IFExtDsgnCU cu, ExtDesignKey key) { TWMIFEXTDSGN_CU entity = new TWMIFEXTDSGN_CU(); entity.CD_SEQ_EXTDSGN = GetIfSequenceNo(); // entity.CD_SEQ_EXTDSGN = cu.ExternalDesignSequence; entity.TS_EXTDSGN = key.TsExtDsgn; entity.ID_OPER = key.IdOper; entity.NO_POINT = String.IsNullOrEmpty(cu.PointNumber) ? " " : cu.PointNumber; //NotNull entity.NO_POINT_SPAN = String.IsNullOrEmpty(cu.PointSpanNumber) ? " " : cu.PointSpanNumber; //NotNull entity.CD_CU = cu.CUCode; // entity.IND_ACCT = cu.AccountIndicator; entity.IND_ACCT = String.IsNullOrEmpty(cu.AccountIndicator) ? GetCUAccount(cu.CUCode) : cu.AccountIndicator; //NotNull - C, M or O entity.IND_ON_OFF = String.IsNullOrEmpty(cu.OnOffIndicator) ? "N" : cu.OnOffIndicator; //NotNull entity.FG_CNTCR = cu.ContractorFlag; //NotNull entity.CD_USAGE = String.IsNullOrWhiteSpace(cu.UsageCode) ? GetCUUsage(cu.CUCode) : cu.UsageCode; //NotNull - get from twmCU table entity.CD_SUPPLY_METHOD = String.IsNullOrEmpty(cu.SupplyMethodCode) ? " " : cu.SupplyMethodCode; //NotNull entity.NO_EQUIP = String.IsNullOrEmpty(cu.EquipmentNumber) ? " " : cu.EquipmentNumber; //NotNull entity.CD_WO = string.Empty; entity.DT_COMPLETE = DateTime.Now; // entity.DT_COMPLETE = cu.CompletionDate; entity.IND_ACTION = String.IsNullOrEmpty(cu.ActionIndicator) ? " " : cu.ActionIndicator; //NotNull // entity.QT_ACTION = String.IsNullOrEmpty(cu.ActionQuantity) ? -1 : (decimal)int.Parse(cu.ActionQuantity); //NotNull entity.QT_ACTION = cu.ActionQuantity; entity.FC_DIFFICULTY = null; entity.CD_DIST = cu.District; // entity.CD_WR = String.IsNullOrEmpty(cu.WorkRequest) ? 0 : Convert.ToInt32(cu.WorkRequest); entity.CD_WR = cu.WorkRequest; entity.CD_WORKPACKET = cu.Workpacket; entity.CD_OWNERSHIP = string.Empty; entity.CD_BDGT_ITEM = string.Empty; entity.CD_CREW = cu.CrewCode; // entity.IND_PROCESS = "A"; //NotNull - A = add, M = modify, D = delete entity.IND_PROCESS = cu.ProcessIndicator; //NotNull - A = add, M = modify, D = delete entity.FG_ERROR = "N"; //NotNull if (key.ExtDsgnFacAttSeq == null) { entity.NO_FACILITY = null; } else { entity.NO_FACILITY = key.ExtDsgnFacAttSeq; } entity.NO_APPLICATION = null; if (cu.MUCode == "NONE") { cu.MUCode = " "; } entity.CD_MU = String.IsNullOrEmpty(cu.MUCode) ? " " : cu.MUCode; //NotNull entity.CD_SEQ_ERROR_RUN = null; return(entity); }
public void CreateExternalDesignCu(List <IFExtDsgnCU> cus, ExtDesignKey key) { IEnumerable <TWMIFEXTDSGN_CU> entities = MapObjectsToIfEntities(cus, key); if (entities != null && entities.Count() > 0) { foreach (var item in entities) { unitOfWork.IfExtDesignCuRepo.Insert(item); unitOfWork.Save(); } } }
public int CreateExternalDesignIf(IFExtDsgnPoint ifExtDsgnPt, ExtDesignKey key) { // TWMIFEXTDSGN_PT entity = MapObjectToPtIfEntity(ifExtDsgnPt, key); TWMIFEXTDSGN_PT entity = MapObjectToIfEntity(ifExtDsgnPt); if (entity != null) { unitOfWork.IfExtDesignPtRepo.Insert(entity); unitOfWork.Save(); } return(0); }
public WMException CallExternalDesign(IFExtDsgnPoint twmifextdsgn_pt_obj, bool finished, DateTime timeofcreate, string oper, string asbOrEstInd) { WMException WMexcept = null; ExtDesignKey key = new ExtDesignKey() { TsExtDsgn = timeofcreate, IdOper = oper }; WMexcept = ExecutePDriver(twmifextdsgn_pt_obj, key, asbOrEstInd); return(WMexcept); }
private TWMIFEXTDSGN_PT MapObjectToPtIfEntity(IFExtDsgnPoint ifpoint, ExtDesignKey key) { TWMIFEXTDSGN_PT entity = new TWMIFEXTDSGN_PT(); entity.CD_SEQ_EXTDSGN = GetIfSequenceNo(); entity.TS_EXTDSGN = key.TsExtDsgn; entity.ID_OPER = key.IdOper; entity.NO_POINT = ifpoint.PointNumber; entity.NO_POINT_SPAN = ifpoint.PointSpanNumber; entity.CD_DIST = ifpoint.District; entity.CD_WR = ifpoint.WorkRequest; entity.AD_GR_1 = string.Empty; entity.AD_GR_2 = string.Empty; entity.TXT_DESN = string.Empty; entity.DT_RPTD = null; entity.DT_IN_SERVICE = null; entity.CD_TOWN_RANGE_SECT = string.Empty; entity.CD_TAX_DIST = string.Empty; entity.CD_SIDE_OF_STREET = string.Empty; entity.IND_WORK_STATUS = " "; entity.IND_MAIN_STATUS = "N"; //N = not designated, L = long, S = short entity.IND_PROCESS = "A"; //A = add, M = modify, D = delete entity.CD_ENTITY = string.Empty; entity.CD_ISOLATION_SECT = string.Empty; entity.CD_LANDMARK = string.Empty; entity.CD_POLITICAL_SUB = string.Empty; entity.CD_SCHOOL_TAX = string.Empty; entity.AMT_FIXED_BID = null; entity.NO_DRAWING = string.Empty; if (ifpoint.SpanLength == null) { entity.LN_SPAN = (decimal?)0.00; } else { entity.LN_SPAN = (decimal?)Convert.ToDecimal(ifpoint.SpanLength); } entity.NO_MAP = string.Empty; entity.AD_POINT = string.Empty; entity.ID_POINT = string.IsNullOrEmpty(ifpoint.PointId) ? string.Empty : ifpoint.PointId; entity.CD_CREW = string.Empty; entity.IND_CNTCR_CALC_MTH = "1"; //1, 2, 3, 4 entity.FG_ERROR = "N"; entity.CD_BID_ITEM = string.Empty; entity.FG_RWORKS = "N"; //"N" or "Y", default is "N" entity.CD_SEQ_ERROR_RUN = null; entity.NO_COMPLEXITY = null; entity.QT_BID_ITEM = 0; return(entity); }
private WMException ExecutePDriver(Design design, ExtDesignKey key) { WMException wme = null; DesignError error = unitOfWork.DesignRepo.Insert(MapObjectToEntity(design), key.TsExtDsgn, key.IdOper); if (error != null) { wme = CreateWMException(error.v_fg_error , error.v_cd_seq_error , error.v_cd_sqlcode , error.v_nm_interface , error.v_ts_error , error.v_txt_sqlerrtext , error.v_txt_iferror , error.v_cd_seq_error_run , error.v_cd_district , error.v_cd_workpacket , error.v_cd_crew , error.v_cd_project , error.v_id_empl , error.v_cd_fleet , error.v_nm_table , error.v_nm_column , error.v_fg_data_error , error.v_ts_error_logged); } //TODO: create the multispeak library and put all of this there if (wme == null) { //////if success set the 211 to Complete ////new MilestoneRequirementBl(dbManagerBase.iOrigin, dbManagerBase.iEnvironment).SetRequirementStatus("211", design.WorkRequestID, "C"); //////set the 491 Required ////new MilestoneRequirementBl(dbManagerBase.iOrigin, dbManagerBase.iEnvironment).SetRequirementStatus("491", design.WorkRequestID, "R"); //TODO: create the multispeak library //get Approval Queue //WorkRequest wr = new WorkRequestBl(dbManagerBase.iOrigin, dbManagerBase.iEnvironment).GetWorkRequest(Int32.Parse(design.WorkRequestID)); //MultiSpeakType mst = new MultiSpeakTypeDal().GetMultiSpeakTypeByWorkRequest(wr, Active.Yes); //TODO: create the multispeak library //set 491 Responsible to the correct Approval Queue //new MilestoneRequirementBl(dbManagerBase.iOrigin, dbManagerBase.iEnvironmentType).SetRequirementOperator("491", design.WorkRequestID.ToString(), mst.StormsApprovalQueue, "XXGEO_DO"); } return(wme); }
public int CreateExternalDesign(Design design, List <Point> points, ExtDesignKey key) { IEnumerable <TWMIFEXTDSGN_PT> entities = MapObjectsToIfEntities(design, points, key); if (entities != null && entities.Count() > 0) { foreach (var item in entities) { unitOfWork.IfExtDesignPtRepo.Insert(item); unitOfWork.Save(); } } return(0); }
public TWMIFEXTDSGN_FAC MapObjectToFacIfEntity(IFExtDsgnFacAtt fa, ExtDesignKey key) { TWMIFEXTDSGN_FAC entity = new TWMIFEXTDSGN_FAC(); entity.CD_SEQ_EXTDSGN = GetIfSequenceNo2(); entity.TS_EXTDSGN = key.TsExtDsgn; entity.ID_OPER = key.IdOper; entity.NO_FACILITY = (long)key.ExtDsgnFacAttSeq; entity.CD_SEQ = fa.SequenceCode; entity.TXT_FAC_VALUE = fa.FacilityValueText; entity.CD_ATTRIBUTE = fa.AttributeCode; entity.FG_ERROR = "N"; entity.CD_SEQ_ERROR_RUN = 0; return(entity); }
public TWMIFEXTDSGN_FAC MapObjectToIfEntity(CUFacilityAttribute fa, ExtDesignKey key) { TWMIFEXTDSGN_FAC entity = new TWMIFEXTDSGN_FAC(); entity.CD_SEQ_EXTDSGN = GetIfSequenceNo2(); entity.TS_EXTDSGN = key.TsExtDsgn; //PK entity.ID_OPER = key.IdOper; //PK entity.NO_FACILITY = (long)key.ExtDsgnFacAttSeq; //PK -- seq generated entity.CD_SEQ = fa.IdSeq; //PK entity.TXT_FAC_VALUE = fa.Value; entity.CD_ATTRIBUTE = fa.AttributeName; //PK entity.FG_ERROR = "N"; entity.CD_SEQ_ERROR_RUN = null; return(entity); }
public void CreateExternalDesign(string district, List <CU> CUPoints, ExtDesignKey key) { foreach (CU cup in CUPoints) { key.ExtDsgnFacAttSeq = null; if (cup.CUFacilityAttributes != null && cup.CUFacilityAttributes.Count > 0) { key.ExtDsgnFacAttSeq = (int)GetIfSequenceNo(); } //insert CUs CreateExternalDesign(cup, district, key); //insert FAs CreateFacilityAttributes(cup, key); } }
public TWMIFEXTDSGN_CU MapObjectToIfEntity(CU cu, string district, ExtDesignKey key) { TWMIFEXTDSGN_CU entity = new TWMIFEXTDSGN_CU(); entity.CD_SEQ_EXTDSGN = GetIfSequenceNo(); entity.TS_EXTDSGN = key.TsExtDsgn; entity.ID_OPER = key.IdOper; entity.NO_POINT = String.IsNullOrEmpty(cu.PointNumber) ? " " : cu.PointNumber; //NotNull entity.NO_POINT_SPAN = String.IsNullOrEmpty(cu.PointSpanNumber) ? " " : cu.PointSpanNumber; //NotNull entity.CD_CU = cu.UnitCode; entity.IND_ACCT = String.IsNullOrEmpty(cu.Account) ? GetCUAccount(cu.UnitCode) : cu.Account; //NotNull - C, M or O entity.IND_ON_OFF = String.IsNullOrEmpty(cu.OnOff) ? "N" : cu.OnOff; //NotNull entity.FG_CNTCR = "N"; //NotNull entity.CD_USAGE = GetCUUsage(cu.UnitCode); //NotNull - get from twmCU table entity.CD_SUPPLY_METHOD = String.IsNullOrEmpty(cu.SupplyMethod) ? " " : cu.SupplyMethod; //NotNull entity.NO_EQUIP = String.IsNullOrEmpty(cu.EquipNumber) ? " " : cu.EquipNumber; //NotNull entity.CD_WO = string.Empty; entity.DT_COMPLETE = null; entity.IND_ACTION = String.IsNullOrEmpty(cu.UnitAction) ? " " : cu.UnitAction; //NotNull entity.QT_ACTION = String.IsNullOrEmpty(cu.Quantity) ? -1 : (decimal)int.Parse(cu.Quantity); //NotNull entity.FC_DIFFICULTY = null; entity.CD_DIST = district; entity.CD_WR = String.IsNullOrEmpty(cu.WorkRequest) ? 0 : Convert.ToInt32(cu.WorkRequest); entity.CD_OWNERSHIP = string.Empty; entity.CD_BDGT_ITEM = string.Empty; entity.CD_CREW = string.Empty; entity.IND_PROCESS = "A"; //NotNull - A = add, M = modify, D = delete entity.FG_ERROR = "N"; //NotNull if (key.ExtDsgnFacAttSeq == null) { entity.NO_FACILITY = null; } else { entity.NO_FACILITY = key.ExtDsgnFacAttSeq; } entity.NO_APPLICATION = null; entity.CD_MU = String.IsNullOrEmpty(cu.MUID) ? " " : cu.MUID; //NotNull entity.CD_SEQ_ERROR_RUN = null; entity.CD_WORKPACKET = null; return(entity); }
public WMException CreateExternalDesignFromIf(IFExtDsgnCU twmifextdsgn_cu_obj, DateTime timeOfCreate, string oper, string asbOrEstInd) { WMException WMexcept = null; ExtDesignKey key = new ExtDesignKey() { TsExtDsgn = timeOfCreate, IdOper = oper }; // foreach (IFExtDsgnCU cuIf in twmifextdsgn_cu_objs) // { /////////////////// ////get the next Oracle WE_S_SO_EXTDSG // ExtDesignKey key = new ExtDesignKey() { TsExtDsgn = DateTime.Now, IdOper = twmifextdsgn_pt_obj.OperatorId }; // ExtDesignKey key = new ExtDesignKey() { TsExtDsgn = twmifextdsgn_cu_objs[0].ExternalDesignTimeStamp, IdOper = twmifextdsgn_cu_objs[0].OperatorId }; /////////////////// ////insert Points// // new PointBl().CreateExternalDesign(design, design.Points, key); /////////////////////// ////insert CUs /FAC's// // CreateCUsFacilityAttributes(design, key); key.ExtDsgnFacAttSeq = null; if (twmifextdsgn_cu_obj.IfExtDsgnFacAtt != null && twmifextdsgn_cu_obj.IfExtDsgnFacAtt.Count > 0) { key.ExtDsgnFacAttSeq = (int)GetIfSequenceNo(); } CreateExternalDesignCuIf(twmifextdsgn_cu_obj, key); CreateFacilityAttributes(twmifextdsgn_cu_obj, key); // } /////////////////// ////call P Driver// // WMexcept = ExecutePDriver(twmifextdsgn_cu_obj, key); return(WMexcept); }
// ------------------------- private TWMIFEXTDSGN_CU MapObjectToCuIfEntity(IFExtDsgnCU ifcu, ExtDesignKey key) { TWMIFEXTDSGN_CU entity = new TWMIFEXTDSGN_CU(); entity.CD_SEQ_EXTDSGN = GetIfSequenceNo(); entity.TS_EXTDSGN = key.TsExtDsgn; entity.ID_OPER = key.IdOper; entity.NO_POINT = ifcu.PointNumber; entity.NO_POINT_SPAN = ifcu.PointSpanNumber; entity.CD_DIST = ifcu.District; entity.CD_WR = ifcu.WorkRequest; entity.CD_BDGT_ITEM = ""; entity.CD_CREW = ifcu.CrewCode; entity.CD_CU = ifcu.CUCode; entity.CD_MU = ifcu.MUCode; entity.CD_USAGE = ifcu.UsageCode; entity.CD_WORKPACKET = ifcu.Workpacket; entity.DT_COMPLETE = ifcu.CompletionDate; entity.IND_ACCT = ifcu.AccountIndicator; entity.IND_ON_OFF = ifcu.OnOffIndicator; entity.IND_PROCESS = ifcu.ProcessIndicator; entity.QT_ACTION = ifcu.ActionQuantity; // entity.CD_SEQ_EXTDSGN = GetIfSequenceNo(); entity.CD_SEQ_EXTDSGN = ifcu.ExternalDesignSequence; entity.ID_OPER = ifcu.OperatorId; entity.NO_POINT = ifcu.PointNumber; entity.NO_POINT_SPAN = ifcu.PointSpanNumber; entity.TS_EXTDSGN = ifcu.ExternalDesignTimeStamp; entity.CD_SEQ_ERROR_RUN = ifcu.ErrorRunSequence; entity.FG_ERROR = ifcu.ErrorFlag; entity.FG_CNTCR = ifcu.ContractorFlag; entity.CD_SUPPLY_METHOD = ifcu.SupplyMethodCode; entity.IND_ACTION = ifcu.ActionIndicator; entity.NO_EQUIP = ifcu.EquipmentNumber; entity.NO_FACILITY = ifcu.FacilityNumber; // FC_DIFFICULTY = obj // CD_BDGT_ITEM = obj. // CD_SEQ_ERROR_RUN = GetIfSequenceNo() return(entity); }
private WMException ExecutePDriver(IFExtDsgnPoint ifpoint, ExtDesignKey key, string asbOrEstInd) { WMException wme = null; DesignIfError error = unitOfWork.IfExtDsgnPtRepo.Insert(MapObjectToIfEntity(ifpoint), asbOrEstInd); if (error != null) { wme = CreateWMException(error.v_fg_error , error.v_cd_seq_error , error.v_cd_sqlcode , error.v_nm_interface , error.v_ts_error , error.v_txt_sqlerrtext , error.v_txt_iferror , error.v_cd_seq_error_run , error.v_cd_district , error.v_cd_workpacket , error.v_cd_crew , error.v_cd_project , error.v_id_empl , error.v_cd_fleet , error.v_nm_table , error.v_nm_column , error.v_fg_data_error , error.v_ts_error_logged); } if (wme == null) { } return(wme); }
public void CreateExternalDesign(CU cu, string district, ExtDesignKey key) { unitOfWork.IfExtDesignCuRepo.Insert(MapObjectToIfEntity(cu, district, key)); unitOfWork.Save(); }
public IEnumerable <TWMIFEXTDSGN_PT> MapObjectsToPtIfEntities(List <IFExtDsgnPoint> objs, ExtDesignKey key) { List <TWMIFEXTDSGN_PT> entities = new List <TWMIFEXTDSGN_PT>(); foreach (var item in objs) { entities.Add(MapObjectToPtIfEntity(item, key)); } return(entities); }
public void CreateExternalDesignCuIf(IFExtDsgnCU cu, ExtDesignKey key) { unitOfWork.IfExtDesignCuRepo.Insert(MapObjectToIfEntity(cu, key)); unitOfWork.Save(); }