public ReceivingNoteItem[] getReceivingNoteDetail(GetReceivingNoteDetailRequest request)
    {
        DetachedCriteria criteria = DetachedCriteria.For<ReceiptDetail>();
        criteria.Add(Expression.Eq("ReceiptNo",request.receivingNo));
        IList<ReceiptDetail> reciptDetailList = TheCriteriaMgr.FindAll<ReceiptDetail>(criteria);
        List<ReceivingNoteItem> receivingNoteItemList = new List<ReceivingNoteItem>();
        foreach (ReceiptDetail receiptDetail in reciptDetailList)
        {
            ReceivingNoteItem item = new ReceivingNoteItem();

            //set unit of messure
            UOM uom = new UOM();
            uom.id = receiptDetail.OrderLocationTransaction.Item.Uom.Code;
            uom.abbreviation = receiptDetail.OrderLocationTransaction.Item.Uom.Name;
            uom.description = receiptDetail.OrderLocationTransaction.Item.Uom.Name;

            //set supplier Item
            Material suppItem = new Material();
            suppItem.id = receiptDetail.OrderLocationTransaction.OrderDetail.ReferenceItemCode;
            suppItem.no = receiptDetail.OrderLocationTransaction.OrderDetail.ReferenceItemCode;
            suppItem.description = receiptDetail.OrderLocationTransaction.OrderDetail.ReferenceItemCode;
            suppItem.quantityUOM = uom;

            //set Item
            Material material = new Material();
            material.id = receiptDetail.OrderLocationTransaction.Item.Code;
            material.no = receiptDetail.OrderLocationTransaction.Item.Code;
            material.name = receiptDetail.OrderLocationTransaction.Item.Description;
            material.description = receiptDetail.OrderLocationTransaction.Item.Description;
            material.quantityUOM = uom;

            item.material = material;


            item.receiveQuantity = Convert.ToDouble(receiptDetail.ReceivedQty);
            item.receiveQuantitySpecified = true;
            
            //不知道怎么取
            item.totalBillingQuantity = Convert.ToDouble(receiptDetail.ReceivedQty);
            item.totalBillingQuantitySpecified = true;
            item.billingStatus = string.Empty;

            item.unitCount = Convert.ToDouble(receiptDetail.OrderLocationTransaction.OrderDetail.UnitCount);
            item.unitCountSpecified = true;
        }
        return null;
    }
 public static void CreateAttributeTemplate(string name, AFElementTemplate elementTemplate, Type attributeType, UOM attributeUOM)
 {
     AFAttributeTemplate myAttributeTemplate = elementTemplate.AttributeTemplates[name];
     if (myAttributeTemplate == null)
     {
         myAttributeTemplate = elementTemplate.AttributeTemplates.Add(name);
     }
     myAttributeTemplate.DataReferencePlugIn = myPISystem.DataReferencePlugIns["PI Point"];
     myAttributeTemplate.Type = attributeType;
     myAttributeTemplate.DefaultUOM = attributeUOM;
     if (myAttributeTemplate.DefaultUOM == null)
     {
         myAttributeTemplate.ConfigString = @"\\" + PIServerName + @"\%Element%_%Attribute%;";
     }
     else
     {
         myAttributeTemplate.ConfigString = @"\\" + PIServerName + @"\%Element%_%Attribute%;UOM=" + myAttributeTemplate.DefaultUOM.Abbreviation;
     }
 }
예제 #3
0
        public ActionResult Create(UOM uom)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    List<string> errorMessage = new List<string>();
                    if (UOMService.FindBy(p => p.UOMName.Trim() == uom.UOMName.Trim()).Count() > 0)
                    {
                        errorMessage.Add("UOM alreary exists with same name");
                    }

                    if (!uom.ISStandardUOM)
                    {
                        if (string.IsNullOrEmpty(uom.StandardUOM))
                        {
                            errorMessage.Add("Please Select Standard UOM");
                        }
                        if (uom.UOMMapping == 0)
                        {
                            errorMessage.Add("Please enter mapping Details");
                        }
                    }
                    if (errorMessage.Count > 0)
                    {
                        return Json(new { errorMessage });
                    }
                    else
                    {
                        UOMService.Create(uom);
                    }
                }
                return View();
            }
            catch
            {
                return View(uom);
            }
        }
예제 #4
0
        public ActionResult Create(UOM uom)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    if (UOMService.FindBy(p => p.UOMName.Trim() == uom.UOMName.Trim()).Count() > 0)
                    {
                        ModelState.AddModelError("", "UOM alreary exists with same name");
                        return View();
                    }

                    bool isModelValid = true;
                    if (!uom.ISStandardUOM)
                    {
                        if (string.IsNullOrEmpty(uom.StandardUOM))
                        {
                            ModelState.AddModelError("", "Please Select Standard UOM");
                            isModelValid = false;
                        }
                        else if (uom.UOMMapping == 0)
                        {
                            ModelState.AddModelError("", "Please enter mapping Details");
                            isModelValid = false;
                        }
                    }
                    if (isModelValid)
                    {
                        UOMService.Create(uom);
                    }
                }
            }
            catch { }

            return View();
        }
예제 #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="inputValues"></param>
        /// <param name="defaultUOM"></param>
        /// <param name="comparisonValue"></param>
        /// <param name="comparisonOperator"></param>
        /// <returns></returns>
        public AFValue Count(AFValues inputValues, UOM defaultUOM, string comparisonValue, string comparisonOperator)
        {
            AFTime time = new AFTime();

            time = inputValues[0].Timestamp;
            try
            {
                long   _count = 0;
                double dComparisonValue;
                if (Double.TryParse(comparisonValue, out dComparisonValue))
                {
                    foreach (AFValue inputVal in inputValues)
                    {
                        if (inputVal.IsGood && inputVal != null)
                        {
                            double dCurrVal;

                            // make sure we do all operations in same UOM, if applicable
                            if (inputVal.UOM != null && defaultUOM != null && inputVal.UOM != defaultUOM)
                            {
                                dCurrVal = defaultUOM.Convert(inputVal.Value, inputVal.UOM);
                            }
                            else
                            {
                                dCurrVal = Convert.ToDouble(inputVal.Value);
                            }

                            switch (comparisonOperator)
                            {
                            case "LT":
                                if (dCurrVal < dComparisonValue)
                                {
                                    _count++;
                                }
                                break;

                            case "LE":
                                if (dCurrVal <= dComparisonValue)
                                {
                                    _count++;
                                }
                                break;

                            case "EQ":
                                if (dCurrVal == dComparisonValue)
                                {
                                    _count++;
                                }
                                break;

                            case "GE":
                                if (dCurrVal >= dComparisonValue)
                                {
                                    _count++;
                                }
                                break;

                            case "GT":
                                if (dCurrVal > dComparisonValue)
                                {
                                    _count++;
                                }
                                break;

                            case "NE":
                                if (dCurrVal != dComparisonValue)
                                {
                                    _count++;
                                }
                                break;

                            case "Is Good":
                                if (inputVal.IsGood)
                                {
                                    _count++;
                                }
                                break;

                            case "Is Bad":
                                if (!inputVal.IsGood)
                                {
                                    _count++;
                                }
                                break;

                            default:
                                break;
                            }
                        }
                    }
                }
                else
                {
                    // comparison value is not numeric, only valid options should be equality or inequality, and value quality
                    foreach (AFValue inputVal in inputValues)
                    {
                        if (inputVal.IsGood && inputVal != null)
                        {
                            switch (comparisonOperator)
                            {
                            case "EQ":
                                if (String.Compare(inputVal.ToString(), comparisonValue, false) == 0)
                                {
                                    _count++;
                                }
                                break;

                            case "NE":
                                if (String.Compare(inputVal.ToString(), comparisonValue, false) != 0)
                                {
                                    _count++;
                                }
                                break;

                            case "Is Good":
                                if (inputVal.IsGood)
                                {
                                    _count++;
                                }
                                break;

                            case "Is Bad":
                                if (!inputVal.IsGood)
                                {
                                    _count++;
                                }
                                break;

                            default:
                                break;
                            }
                        }
                    }
                }
                return(new AFValue(_count, time));
                //return new AFValue(_count, (AFTime)DateTime.Now);
            }
            catch
            {
                return(new AFValue(Double.NaN, (AFTime)DateTime.Now, null, AFValueStatus.Bad));
            }
        }
예제 #6
0
파일: UOMDTO.cs 프로젝트: bacca87/great2
 public UOMDTO(UOM uom)
 {
     Auto.Mapper.Map(uom, this);
 }
예제 #7
0
 public FitbitStream(TimeSeriesResourceType fitbitSource, string attributeName, UOM uom)
 {
     FitbitSource = fitbitSource;
     AttributeName = attributeName;
     UnitsOfMeasure = uom;
 }
    private RequisitionOrderItem fillOrderDetail(OrderDetail orderDetail)
    {

        RequisitionOrderItem item = new RequisitionOrderItem();

        
        item.id = orderDetail.Id.ToString();
        item.sequenceNo = orderDetail.Sequence;
        item.sequenceNoSpecified = true;
        item.memo = string.Empty;
        item.requiredQuantity = Convert.ToDouble(orderDetail.OrderedQty);
        item.requiredQuantitySpecified = true;
        item.deliveredQuantity = 0;
        if (orderDetail.ShippedQty != null)
        {
            item.deliveredQuantity = Convert.ToDouble(orderDetail.ShippedQty);
        }
        item.deliveredQuantitySpecified = true;
        item.receivedQuantity = 0;
        if (orderDetail.ReceivedQty != null)
        {
            item.receivedQuantity = Convert.ToDouble(orderDetail.ReceivedQty);
        }
        item.receivedQuantitySpecified = true;
        item.unitCount = Convert.ToDouble(orderDetail.UnitCount);
        item.unitCountSpecified = true;

        UOM u = new UOM();
        u.abbreviation = orderDetail.Uom.Code;
        u.description = orderDetail.Uom.Description;

        Material m = new Material();
        m.quantityUOM = u;
        m.id = orderDetail.Item.Code;
        m.no = orderDetail.Item.Code;
        m.name = orderDetail.Item.Description;
        m.description = orderDetail.Item.Description;

        Material supM = new Material();
        supM.quantityUOM = u;
        supM.id = orderDetail.ReferenceItemCode;
        supM.no = orderDetail.ReferenceItemCode;
        supM.name = orderDetail.ReferenceItemCode;
        supM.description = orderDetail.ReferenceItemCode;

        string2MaterialMapEntry[] mapEntry = new string2MaterialMapEntry[1];
        mapEntry[0] = new string2MaterialMapEntry();
        mapEntry[0].key = string.Empty;
        mapEntry[0].value = supM;
        m.supplierMaterials = mapEntry;

        item.material = m;

        return item;
    }
        public void gvHSTMetricsList_OnRowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
        {
            if ((!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Header.ToString())) & (!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Footer.ToString())))
            {
                Label   lbl;
                decimal val;
                UOM     uom = null;

                try
                {
                    HiddenField hf = (HiddenField)e.Row.Cells[0].FindControl("hfHSTMetricID");
                    lbl = (Label)e.Row.Cells[0].FindControl("lblHSTMetricName");

                    EHS_PROFILE_MEASURE measure = currentProfile.Profile.EHS_PROFILE_MEASURE.Where(l => l.MEASURE_ID == Convert.ToDecimal(hf.Value)).FirstOrDefault();
                    lbl.Text = measure.EHS_MEASURE.MEASURE_NAME.Trim();
                    lbl      = (Label)e.Row.Cells[0].FindControl("lblHSTMetricCode");
                    lbl.Text = measure.EHS_MEASURE.MEASURE_CD;

                    if ((bool)measure.IS_REQUIRED)
                    {
                        // System.Web.UI.HtmlControls.HtmlTableCell cell1 = (System.Web.UI.HtmlControls.HtmlTableCell)e.Row.Cells[0].FindControl("lblInvoiceDateFrom");
                        e.Row.Cells[1].Attributes.Add("Class", "required");
                    }

                    if (measure.EHS_MEASURE.MEASURE_CATEGORY == "ENGY" || measure.EHS_MEASURE.MEASURE_CATEGORY == "EUTL")
                    {
                        e.Row.Cells[0].Attributes.Add("Class", "textStd energyColor");
                    }
                    else
                    {
                        e.Row.Cells[0].Attributes.Add("Class", "textStd wasteColor");
                    }

                    lbl = (Label)e.Row.Cells[0].FindControl("lblHSTValue");
                    if (!string.IsNullOrEmpty(lbl.Text))
                    {
                        if (Decimal.TryParse(lbl.Text, out val))
                        {
                            lbl.Text = SQMBasePage.FormatValue(val, 2);
                        }
                    }

                    lbl = (Label)e.Row.Cells[0].FindControl("lblHSTInputValue");
                    if (!string.IsNullOrEmpty(lbl.Text))
                    {
                        if (Decimal.TryParse(lbl.Text, out val))
                        {
                            lbl.Text = SQMBasePage.FormatValue(val, 2);
                        }
                    }

                    lbl = (Label)e.Row.Cells[0].FindControl("lblHSTCost");
                    if (!string.IsNullOrEmpty(lbl.Text))
                    {
                        if (Decimal.TryParse(lbl.Text, out val))
                        {
                            lbl.Text = SQMBasePage.FormatValue(val, 2);
                        }
                    }

                    lbl = (Label)e.Row.Cells[0].FindControl("lblHSTInputCost");
                    if (!string.IsNullOrEmpty(lbl.Text))
                    {
                        if (Decimal.TryParse(lbl.Text, out val))
                        {
                            lbl.Text = SQMBasePage.FormatValue(val, 2);
                        }
                    }

                    lbl = (Label)e.Row.Cells[0].FindControl("lblHSTValueUOM");
                    uom = SessionManager.UOMList.FirstOrDefault(l => l.UOM_ID == Convert.ToDecimal(lbl.Text));
                    if (uom != null)
                    {
                        lbl.Text = uom.UOM_CD;
                    }

                    lbl = (Label)e.Row.Cells[0].FindControl("lblHSTInputUOM");
                    uom = SessionManager.UOMList.FirstOrDefault(l => l.UOM_ID == Convert.ToDecimal(lbl.Text));
                    if (uom != null)
                    {
                        lbl.Text = uom.UOM_CD;
                    }
                }
                catch
                {
                }
            }
        }
        public void gvInputsList_OnRowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
        {
            if ((!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Header.ToString())) & (!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Footer.ToString())))
            {
                Label    lbl;
                DateTime dt;
                UOM      uom = null;

                try
                {
                    HiddenField hf = (HiddenField)e.Row.Cells[0].FindControl("hfPRMRID");
                    lbl = (Label)e.Row.Cells[0].FindControl("lblMetricName");

                    EHS_PROFILE_MEASURE measure = currentProfile.Profile.EHS_PROFILE_MEASURE.Where(l => l.PRMR_ID == Convert.ToDecimal(hf.Value)).FirstOrDefault();
                    lbl.Text = measure.EHS_MEASURE.MEASURE_NAME.Trim();
                    lbl      = (Label)e.Row.Cells[0].FindControl("lblMetricCode");
                    lbl.Text = measure.EHS_MEASURE.MEASURE_CD;

                    if ((bool)measure.IS_REQUIRED)
                    {
                        e.Row.Cells[1].Attributes.Add("Class", "required");
                    }

                    hf = (HiddenField)e.Row.Cells[0].FindControl("hfStatus");
                    if (hf.Value == "D")
                    {
                        Image img = (Image)e.Row.Cells[0].FindControl("imgStatus");
                        img.ImageUrl = "~/images/defaulticon/16x16/delete.png";
                        img.Visible  = true;
                    }

                    if (measure.EHS_MEASURE.MEASURE_CATEGORY == "ENGY" || measure.EHS_MEASURE.MEASURE_CATEGORY == "EUTL")
                    {
                        e.Row.Cells[0].Attributes.Add("Class", "textStd energyColor");
                    }
                    else if (measure.EHS_MEASURE.MEASURE_CATEGORY == "PROD" || measure.EHS_MEASURE.MEASURE_CATEGORY == "SAFE")
                    {
                        ;
                    }
                    else
                    {
                        e.Row.Cells[0].Attributes.Add("Class", "textStd wasteColor");
                    }

                    lbl = (Label)e.Row.Cells[0].FindControl("lblInvoiceDateFrom");
                    if (!string.IsNullOrEmpty(lbl.Text))
                    {
                        dt       = Convert.ToDateTime(lbl.Text);
                        lbl.Text = SQMBasePage.FormatDate(dt, "d", false);
                    }
                    lbl = (Label)e.Row.Cells[0].FindControl("lblInvoiceDateTo");
                    if (!string.IsNullOrEmpty(lbl.Text))
                    {
                        dt       = Convert.ToDateTime(lbl.Text);
                        lbl.Text = SQMBasePage.FormatDate(dt, "d", false);
                    }

                    lbl = (Label)e.Row.Cells[0].FindControl("lblValue");
                    if (!string.IsNullOrEmpty(lbl.Text))
                    {
                        decimal val;
                        if (Decimal.TryParse(lbl.Text, out val))
                        {
                            lbl.Text = SQMBasePage.FormatValue(val, 2);
                        }
                    }

                    lbl = (Label)e.Row.Cells[0].FindControl("lblCost");
                    if (!string.IsNullOrEmpty(lbl.Text))
                    {
                        decimal val;
                        if (Decimal.TryParse(lbl.Text, out val))
                        {
                            if (val < 0)
                            {
                                lbl.Text = "";
                                lbl      = (Label)e.Row.Cells[0].FindControl("lblCredit");
                            }
                            lbl.Text = SQMBasePage.FormatValue(val, 2);
                        }
                    }

                    lbl = (Label)e.Row.Cells[0].FindControl("lblValueUOM");
                    uom = SessionManager.UOMList.FirstOrDefault(l => l.UOM_ID == Convert.ToDecimal(lbl.Text));
                    if (uom != null)
                    {
                        lbl.Text = uom.UOM_CD;
                    }
                }
                catch
                {
                }
            }
        }
        private void AddAttributeTemplate(AFElementTemplate template, string name, Type type, bool hasPiPointDr, UOM uom, string categoryName)
        {
            if (template.AttributeTemplates[name] == null)
            {
                AFAttributeTemplate attributeTemplate = template.AttributeTemplates.Add(name);
                attributeTemplate.Type       = type;
                attributeTemplate.DefaultUOM = uom;

                if (hasPiPointDr == true)
                {
                    attributeTemplate.DataReferencePlugIn = piSystem.DataReferencePlugIns["PI Point"];
                    if (attributeTemplate.DefaultUOM == null)
                    {
                        attributeTemplate.ConfigString = @"\\" + piServer.Name + @"\CityBikes_%@..\|Id%_%@Id%_%Attribute%";
                    }
                    else
                    {
                        attributeTemplate.ConfigString = @"\\" + piServer.Name + @"\CityBikes_%@..\|Id%_%@Id%_%Attribute%;UOM=" + attributeTemplate.DefaultUOM.Abbreviation;
                    }
                }
                else
                {
                    attributeTemplate.DataReferencePlugIn = null;
                }

                if (string.IsNullOrEmpty(categoryName) == false)
                {
                    attributeTemplate.Categories.Add(categoryName);
                }
            }
        }
예제 #12
0
 public override int GetHashCode()
 {
     return(AssetId.GetHashCode() ^ DepartName.GetHashCode() ^ Total.GetHashCode() ^
            UOM.GetHashCode() ^ UOMId.GetHashCode());
 }
예제 #13
0
        public async Task <int> UpdateAsync(UOM uom)
        {
            var cmd = QueriesCreatingHelper.CreateQueryUpdate(uom);

            return(await DALHelper.Execute(cmd, dbTransaction : DbTransaction, connection : DbConnection));
        }
예제 #14
0
 public ActionResult Edit(long id)
 {
     ViewBag.UOMNames = new SelectList(UOMService.GetAllByIsStandardUOM(true), "UOMName", "UOMName");
     var UOM = new UOM();
     UOM = UOMService.GetById(id);
     return View(UOM);
 }
        void UpdateCalcInput(VmPreviewEqVar wmEqVar)
        {
            try
            {
                SingleValue singleValue = wmEqVar.GetSingleValue();
                KnownUOM knownUOM = wmEqVar.GetKnownUOM();

                if (singleValue == null) return;
                if (singleValue is Constant) return;
                if (singleValue is Literal) return;

                // Check or update the calc UOM
                bool bUpdateCalcUom = false;
                if (knownUOM == null)
                {
                    singleValue.CalcQuantity.AnonUOM = null;
                }
                else if (singleValue.CalcQuantity.AnonUOM == null)
                {
                    bUpdateCalcUom = true;
                }
                else if (!knownUOM.Dimensions.Equals(singleValue.CalcQuantity.AnonUOM.Dimensions))
                {
                    bUpdateCalcUom = true;
                }

                if (bUpdateCalcUom)
                {
                    singleValue.CalcQuantity.AnonUOM = new AnonUOM(knownUOM.Dimensions, _uOMSet);
                }

                double dbl = (wmEqVar.Value ?? double.NaN);

                CalcStatus calcStatus;
                if (double.IsNaN(dbl) || double.IsInfinity(dbl))
                {
                    calcStatus = CalcStatus.Bad;
                }
                else
                {
                    calcStatus = CalcStatus.Good;
                }

                singleValue.CalcQuantity.CalcStatus = calcStatus;

                // Convert the input value to the calc UOM
                double convertedVal = dbl;

                if (knownUOM != null)
                {
                    convertedVal = UOM.Convert(dbl, fromUOM: knownUOM, anonToUOM: singleValue.CalcQuantity.AnonUOM);
                }

                singleValue.CalcQuantity.Value = convertedVal;

                SetMaxUOMLength();
            }
            catch (Exception ex)
            {
                Logging.LogException(ex);
                throw;
            }
        }
예제 #16
0
 public ActionResult Edit(UOM uom)
 {
     try
     {
         if (ModelState.IsValid)
         {
             UOMService.Update(uom);
         }
     }
     catch
     {
     }
     return View(uom);
 }
예제 #17
0
 public Weight(decimal Value, UOM U)
 {
     setWeight(Value, U);
 }
예제 #18
0
    private BillingItem fillBillDetail(BillDetail billDetail)
    {
        com.Sconit.Entity.Svp.BillingItem item = new com.Sconit.Entity.Svp.BillingItem();

        item.memo = string.Empty;
        item.billingQuantity =Convert.ToDouble(billDetail.BilledQty);
        item.unitPrice = billDetail.UnitPrice;
        item.unitPriceSpecified = true;

           UOM u = new UOM();
        u.abbreviation = billDetail.ActingBill.Uom.Code;
        u.description = billDetail.ActingBill.Uom.Description;

        Material m = new Material();
        m.quantityUOM = u;
        m.id = billDetail.ActingBill.Item.Code;
        m.no = billDetail.ActingBill.Item.Code;
        m.name = billDetail.ActingBill.Item.Description;
        m.description = billDetail.ActingBill.Item.Description;

        RequisitionOrder requisitionOrder = new RequisitionOrder();
        requisitionOrder.requisitionOrderNo = billDetail.ActingBill.OrderNo;

        DeliveryOrder deliveryOrder = new DeliveryOrder();
        deliveryOrder.requisitionOrder = requisitionOrder;

        ReceivingNote receiveNote = new ReceivingNote();
        receiveNote.id = billDetail.ActingBill.ReceiptNo;
        receiveNote.receivingNo = billDetail.ActingBill.ReceiptNo;
        receiveNote.deliveryOrder = deliveryOrder;

        ReceivingNoteItem receiveItem = new ReceivingNoteItem();
        receiveItem.material = m;
        receiveItem.receiveQuantity = Convert.ToDouble(billDetail.BilledQty);
        receiveItem.receiveQuantitySpecified = true;
        receiveItem.totalBillingQuantity = Convert.ToDouble( billDetail.BilledQty);
        receiveItem.totalBillingQuantitySpecified = true;
        receiveItem.receivingNote = receiveNote;

        item.material = m;
        item.receivingNoteItem = receiveItem;

        return item;
    }
예제 #19
0
 public override int GetHashCode()
 {
     return(DetailsId.GetHashCode() ^ DetailsName.GetHashCode() ^ Jan.GetHashCode() ^ Feb.GetHashCode() ^ Apr.GetHashCode() ^ May.GetHashCode() ^ Jun.GetHashCode() ^ Jul.GetHashCode() ^ Aug.GetHashCode() ^ Sep.GetHashCode() ^ Oct.GetHashCode() ^ Nov.GetHashCode()
            ^ Dec.GetHashCode() ^ UOM.GetHashCode() ^ UOMID.GetHashCode());
 }
예제 #20
0
        public override AFAttributeList GetInputs(object context)
        {
            AFAttributeList attList = new AFAttributeList();

            attList.Add(this.Attribute.Element.Attributes["Latitude"]);
            attList.Add(this.Attribute.Element.Attributes["Longitude"]);

            _uomMeter = Attribute.PISystem.UOMDatabase.UOMs["meter"];
            _uomMPH = Attribute.PISystem.UOMDatabase.UOMs["mile per hour"];

            return attList;
        }
        public FitbitStream CreateFitbitStream(TimeSeriesResourceType tsResourceType, string attributeName, UOM uom)
        {
            FitbitStream stream = new FitbitStream(tsResourceType, attributeName, uom);

            return stream;
        }
    public InventoryItem[] getSupplierInventory(GetSupplierInventoryRequest request)
    {
        DetachedCriteria criteria = DetachedCriteria.For<SupllierLocationView>();


        if (request.supplierCode != null && request.supplierCode != string.Empty)
        {
            criteria.Add(Expression.Like("PartyFrom.Code", request.supplierCode));
        }

        if (request.company != null && request.company != string.Empty)
        {
            criteria.Add(Expression.Like("PartyFrom.Name", request.company));
        }

        IList<SupllierLocationView> supplierLocationList = TheCriteriaMgr.FindAll<SupllierLocationView>(criteria, request.beginRowIndex, request.beginRowIndex + request.rowSize);
        List<InventoryItem> iItemList = new List<InventoryItem>();

        foreach (SupllierLocationView supplierLocation in supplierLocationList)
        {

            //set region					
            com.Sconit.Entity.Svp.Party party = new com.Sconit.Entity.Svp.Party();
            party.code = supplierLocation.PartyTo.Code;
            party.id = supplierLocation.PartyTo.Code;
            party.description = supplierLocation.PartyTo.Name;
            party.type = supplierLocation.PartyTo.Type;

            //set supplier
            com.Sconit.Entity.Svp.Party supplier = new com.Sconit.Entity.Svp.Party();
            supplier.id = supplierLocation.PartyFrom.Code;
            supplier.code = supplierLocation.PartyFrom.Code;
            supplier.description = supplierLocation.PartyFrom.Name;
            supplier.type = supplierLocation.PartyFrom.Type;

            //set unit of messure
            UOM uom = new UOM();
            uom.id = supplierLocation.Item.Code;
            uom.abbreviation = supplierLocation.Item.Code;
            uom.description = supplierLocation.Item.Description;

            //set supplier Item
            string refItemCode = TheItemReferenceMgr.GetItemReferenceByItem(supplierLocation.Item.Code, supplierLocation.PartyFrom.Code, supplierLocation.PartyTo.Code);
            Material suppItem = new Material();
            suppItem.id = refItemCode;
            suppItem.no = refItemCode;
            suppItem.description = refItemCode;
            suppItem.quantityUOM = uom;

            //set Item
            Material material = new Material();
            material.id = supplierLocation.Item.Code;
            material.no = supplierLocation.Item.Code;
            material.name = supplierLocation.Item.Description;
            material.description = supplierLocation.Item.Description;
            suppItem.quantityUOM = uom;

            //set supplier material
            string2MaterialMapEntry[] suppItemMap = new string2MaterialMapEntry[1];
            suppItemMap[0] = new string2MaterialMapEntry();
            suppItemMap[0].key = supplier.code;
            suppItemMap[0].value = suppItem;
            material.supplierMaterials = suppItemMap;

            //set location
            com.Sconit.Entity.Svp.Location location = new com.Sconit.Entity.Svp.Location();
            location.id = supplierLocation.Location.Code;
            location.name = supplierLocation.Location.Name;

            //set inventory
            InventoryItem iItem = new InventoryItem();
            iItem.ownerParty = party;
            iItem.supplier = supplier;
            iItem.material = material;
            iItem.location = location;
            iItem.quantityOnHand = Convert.ToDouble(supplierLocation.Qty);
            iItem.quantityOnHandSpecified = true;
            iItem.unitCount = Convert.ToDouble(supplierLocation.Item.UnitCount);
            iItem.unitCountSpecified = true;

            iItemList.Add(iItem);
        }

        return iItemList.ToArray();

    }
예제 #23
0
        public int BindProfileMeasure(EHS_PROFILE_MEASURE pm)
        {
            int status = 0;

            pnlMetricEdit.Visible   = true;
            spUOMFactor.Visible     = false;
            pnlMetricEdit.Visible   = true;
            btnMetricCancel.Enabled = true;
            DisplayErrorMessage(null);

            if (SessionManager.GetUserSetting("EHS", "PROFILE_METRIC_DAYDUE") != null && SessionManager.GetUserSetting("EHS", "PROFILE_METRIC_DAYDUE").VALUE.ToUpper() == "Y")
            {
                trMetricDue.Visible = true;
            }
            else
            {
                trMetricDue.Visible = false;
            }

            try
            {
                if (pm == null)
                {
                    ddlMetricID.Enabled             = ddlMetricCost.Enabled = ddlMetricDisposalCode.Enabled = ddlMetricRegStatus.Enabled = ddlMetricUOM.Enabled = ddlMetricCurrency.Enabled = ddlMetricResponsible.Enabled = false;
                    ddlMetricCategory.SelectedIndex = ddlMetricID.SelectedIndex = ddlMetricDisposalCode.SelectedIndex = ddlMetricRegStatus.SelectedIndex = ddlMetricUOM.SelectedIndex = ddlMetricCost.SelectedIndex = ddlMetricResponsible.SelectedIndex = 0;
                    if (ddlMetricCurrency.Items.FindByValue(LocalProfile().Plant.CURRENCY_CODE) != null)
                    {
                        ddlMetricCurrency.SelectedValue = LocalProfile().Plant.CURRENCY_CODE;
                    }
                    lblMetricName.Text         = lblDisposalDesc.Text = "";
                    tbMetricPrompt.Text        = tbUOMFactor.Text = tbWasteCode.Text = "";
                    winMetricEdit.Title        = hfAddMetric.Value;
                    tbValueDflt.Text           = tbCostDflt.Text = "";
                    cbEnableOverride.Checked   = false;
                    cbMetricRequired.Checked   = true;
                    ddlMetricDue.SelectedValue = ddlDayDue.SelectedValue;
                }
                else
                {
                    winMetricEdit.Title = hfUpdateMetric.Value;
                    LocalProfile().CurrentProfileMeasure = pm;
                    LocalProfile().CurrentEHSMeasure     = pm.EHS_MEASURE;

                    if (pm.EHS_MEASURE != null && ddlMetricCategory.Items.FindByValue(pm.EHS_MEASURE.MEASURE_CATEGORY) != null)
                    {
                        ddlMetricCategory.SelectedValue = pm.EHS_MEASURE.MEASURE_CATEGORY;
                        ddlCategoryChanged(ddlMetricCategory, null);
                        ddlMetricID.SelectedValue = WebSiteCommon.PackItemValue(pm.EHS_MEASURE.MEASURE_CATEGORY, pm.EHS_MEASURE.EFM_TYPE, pm.EHS_MEASURE.MEASURE_ID.ToString());
                        lblMetricName.Text        = pm.EHS_MEASURE.MEASURE_CD;

                        if (pm.DAY_DUE.HasValue)
                        {
                            ddlMetricDue.SelectedValue = pm.DAY_DUE.ToString();
                        }
                        else
                        {
                            ddlMetricDue.SelectedValue = ddlDayDue.SelectedValue;
                        }

                        if (pm.EHS_MEASURE.MEASURE_CATEGORY != "PROD" && pm.EHS_MEASURE.MEASURE_CATEGORY != "SAFE" && pm.EHS_MEASURE.MEASURE_CATEGORY != "FACT" && ddlMetricCurrency.Items.FindByValue(pm.DEFAULT_CURRENCY_CODE) != null)
                        {
                            ddlMetricCurrency.SelectedValue = pm.DEFAULT_CURRENCY_CODE;
                        }

                        if (pm.EHS_MEASURE.MEASURE_CATEGORY != "PROD" && pm.EHS_MEASURE.MEASURE_CATEGORY != "SAFE" && pm.EHS_MEASURE.MEASURE_CATEGORY != "FACT" && pm.DEFAULT_UOM > 0)
                        {
                            UOM uom = SessionManager.UOMList.FirstOrDefault(l => l.UOM_ID == pm.DEFAULT_UOM);
                            if (uom != null)
                            {
                                if (ddlMetricUOM.Items.FindByValue(WebSiteCommon.PackItemValue(uom.UOM_CATEGORY, uom.EFM_TYPE, uom.UOM_ID.ToString())) != null)
                                {
                                    ddlMetricUOM.SelectedValue = WebSiteCommon.PackItemValue(uom.UOM_CATEGORY, uom.EFM_TYPE, uom.UOM_ID.ToString());
                                }
                                else
                                {
                                    ddlMetricUOM.SelectedIndex = 0;
                                }

                                if (uom.UOM_CATEGORY == "CUST")
                                {
                                    spUOMFactor.Visible = true;
                                }
                            }

                            if (pm.UOM_FACTOR.HasValue)
                            {
                                tbUOMFactor.Text = SQMBasePage.FormatValue((decimal)pm.UOM_FACTOR, 5);
                            }
                        }

                        if (pm.EHS_MEASURE.MEASURE_CATEGORY != "PROD" && pm.EHS_MEASURE.MEASURE_CATEGORY != "SAFE" && pm.EHS_MEASURE.MEASURE_CATEGORY != "FACT")
                        {
                            if (pm.NEG_VALUE_ALLOWED.HasValue && (bool)pm.NEG_VALUE_ALLOWED)
                            {
                                ddlMetricCost.SelectedValue = "CREDIT";
                            }
                            else
                            {
                                ddlMetricCost.SelectedValue = "COST";
                            }
                        }
                    }

                    tbMetricPrompt.Text = pm.MEASURE_PROMPT;
                    ddlMetricRegStatus.SelectedValue    = pm.REG_STATUS;
                    ddlMetricDisposalCode.SelectedValue = pm.UN_CODE;
                    if (!string.IsNullOrEmpty(pm.UN_CODE))
                    {
                        lblDisposalDesc.Text = SessionManager.DisposalCodeList.FirstOrDefault(l => l.UN_CODE == pm.UN_CODE).DESCRIPTION;
                    }
                    else
                    {
                        lblDisposalDesc.Text = "";
                    }

                    tbWasteCode.Text = pm.WASTE_CODE;

                    if (pm.RESPONSIBLE_ID > 0 && ddlMetricResponsible.Items.FindByValue(pm.RESPONSIBLE_ID.ToString()) != null)
                    {
                        ddlMetricResponsible.SelectedValue = pm.RESPONSIBLE_ID.ToString();
                    }
                    else
                    {
                        ddlMetricResponsible.SelectedIndex = 0;
                    }

                    ddlUOMChanged(ddlMetricUOM, null);
                    ddlMetricStatus.SelectedValue = pm.STATUS;
                    cbMetricRequired.Checked      = (bool)pm.IS_REQUIRED;

                    tbValueDflt.Text         = tbCostDflt.Text = "";
                    cbEnableOverride.Checked = false;
                    // radEffEndDate.ShowPopupOnFocus = true;
                    //radEffEndDate.SelectedDate = null;
                    if (pm.EHS_PROFILE_MEASURE_EXT != null && pm.EHS_PROFILE_MEASURE_EXT.VALUE_DEFAULT.HasValue)
                    {
                        tbValueDflt.Text = SQMBasePage.FormatValue((decimal)pm.EHS_PROFILE_MEASURE_EXT.VALUE_DEFAULT, 2);
                    }
                    if (pm.EHS_PROFILE_MEASURE_EXT != null && pm.EHS_PROFILE_MEASURE_EXT.COST_DEFAULT.HasValue)
                    {
                        tbCostDflt.Text = SQMBasePage.FormatValue((decimal)pm.EHS_PROFILE_MEASURE_EXT.COST_DEFAULT, 2);
                    }
                    if (pm.EHS_PROFILE_MEASURE_EXT != null && pm.EHS_PROFILE_MEASURE_EXT.OVERRIDE_ALLOWED.HasValue)
                    {
                        cbEnableOverride.Checked = (bool)pm.EHS_PROFILE_MEASURE_EXT.OVERRIDE_ALLOWED;
                    }
                    //if (pm.EHS_PROFILE_MEASURE_EXT != null && pm.EHS_PROFILE_MEASURE_EXT.EFF_END_DT.HasValue)
                    //    radEffEndDate.SelectedDate = pm.EHS_PROFILE_MEASURE_EXT.EFF_END_DT;
                }

                UpdateListTitles();
                pnlMetricEdit.Enabled = btnMetricCancel.Enabled = btnMetricSave.Enabled = UserContext.CheckUserPrivilege(SysPriv.config, SysScope.envdata);

                string script = "function f(){OpenMetricEditWindow(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true);
            }

            catch
            {
            }

            return(status);
        }