Esempio n. 1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (OrderID != 0)
            {
                hash ^= OrderID.GetHashCode();
            }
            if (ProductID != 0)
            {
                hash ^= ProductID.GetHashCode();
            }
            if (UnitPrice != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(UnitPrice);
            }
            if (Quantity != 0)
            {
                hash ^= Quantity.GetHashCode();
            }
            if (Discount != 0F)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Discount);
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Esempio n. 2
0
 private void Deletebtn_Click(object sender, EventArgs e)
 {
     try
     {
         Connect connectObj = new Connect();
         con = connectObj.connect();
         SqlCommand cmd = new SqlCommand("DELETE FROM PRODUCT WHERE PID = @pid", con);
         cmd.Parameters.AddWithValue("@pid", ProductID.Text);
         int i = cmd.ExecuteNonQuery();
         con.Close();
         //If count is equal to 1, than show frmMain form
         if (i != 0)
         {
             MessageBox.Show("Product Deletion Successful!", "Captions", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             MessageBox.Show("Product Deletion Failed", "Captions", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         ProductName.Clear();
         ProductID.Clear();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         //MessageBox.Show("Product Not found", "Captions", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     finally
     {
         if (con != null)
         {
             con.Close();
         }
     }
 }
Esempio n. 3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ProductID       pid = ProductID.Unknow;
            CustomProductID cid = CustomProductID.Unknow;

            if (Enum.IsDefined(typeof(CustomProductID), m_Parameter.PumpType))
            {
                cid = (CustomProductID)Enum.Parse(typeof(CustomProductID), m_Parameter.PumpType);
                pid = ProductIDConvertor.Custom2ProductID(cid);
            }
            int pumpCount = m_PumpLocationList.Count;

            if (pid == ProductID.GrasebyF8)
            {
                pumpCount = pumpCount * 2;
            }

            if (m_PumpLocationList != null && pumpCount <= 15)
            {
                this.Height   += pumpCount * 40;
                this.Height   += 8;
                scroll.Height += pumpCount * 40;
                scroll.Height += 8;
            }
            else
            {
                this.Height   += 16 * 40;
                this.Height   += 8;
                scroll.Height += 15 * 40;
            }

            LoadDetailList();
        }
 private void Clear_Click(object sender, EventArgs e)
 {
     ProductName.Clear();
     VendorID.Clear();
     Amount.Clear();
     ProductID.Clear();
 }
Esempio n. 5
0
        /// <summary>
        /// pumpID 转 成 ProductID
        /// </summary>
        /// <param name="pumpID"></param>
        /// <returns></returns>
        public static ProductID PumpID2ProductID(PumpID pumpID)
        {
            ProductID pid = ProductID.None;

            switch (pumpID)
            {
            case PumpID.GrasebyC8:
                pid = ProductID.GrasebyC8;
                break;

            case PumpID.GrasebyF8:
                pid = ProductID.GrasebyF8;
                break;

            case PumpID.GrasebyF8_2:
                pid = ProductID.GrasebyF8;
                break;

            case PumpID.GrasebyC6:
                pid = ProductID.GrasebyC6;
                break;

            case PumpID.GrasebyF6:
                pid = ProductID.GrasebyF6;
                break;

            case PumpID.GrasebyC6T:
                pid = ProductID.GrasebyC6T;
                break;

            case PumpID.Graseby2100:
                pid = ProductID.Graseby2100;
                break;

            case PumpID.WZ50C6:
                pid = ProductID.GrasebyC6;
                break;

            case PumpID.WZS50F6:
                pid = ProductID.GrasebyF6;
                break;

            case PumpID.WZ50C6T:
                pid = ProductID.GrasebyC6T;
                break;

            case PumpID.GrasebyF6_2:
                pid = ProductID.GrasebyF6;
                break;

            case PumpID.WZS50F6_2:
                pid = ProductID.GrasebyF6;
                break;

            default:
                pid = ProductID.None;
                break;
            }
            return(pid);
        }
Esempio n. 6
0
        public void SetProductID(ProductID id)
        {
            switch (id)
            {
            case ProductID.GrasebyF6:
                m_ProductID = ProductID.GrasebyF6;
                m_Pump      = new F6(m_Client);
                break;

            case ProductID.GrasebyC8:
                m_ProductID = ProductID.GrasebyC8;
                m_Pump      = new C8(m_Client);
                break;

            case ProductID.GrasebyF8:
                m_ProductID = ProductID.GrasebyF8;
                m_Pump      = new F8(m_Client);
                break;

            case ProductID.GrasebyC9:
                m_ProductID = ProductID.GrasebyC9;
                m_Pump      = new C9(m_Client);
                break;

            default:
                m_ProductID = ProductID.GrasebyC8;
                m_Pump      = new C8(m_Client);
                break;
            }
        }
Esempio n. 7
0
 public override bool Equals(object obj)
 {
     return(obj is Item item &&
            ProductID.Equals(item.ProductID) &&
            EqualityComparer <Price> .Default.Equals(CurrentPrice, item.CurrentPrice) &&
            Quantity == item.Quantity);
 }
Esempio n. 8
0
    /// <summary>
    /// Handles the UniGrid's OnAction event.
    /// </summary>
    /// <param name="actionName">Name of item (button) that throws event</param>
    /// <param name="actionArgument">ID (value of Primary key) of corresponding data row</param>
    protected void UniGrid_OnAction(string actionName, object actionArgument)
    {
        if (actionName.ToLowerCSafe() == "edit")
        {
            string editUrl = "Product_Edit_VolumeDiscount_Edit.aspx";
            editUrl = URLHelper.AddParameterToUrl(editUrl, "productID", ProductID.ToString());
            editUrl = URLHelper.AddParameterToUrl(editUrl, "volumeDiscountID", Convert.ToString(actionArgument));
            editUrl = URLHelper.AddParameterToUrl(editUrl, "siteId", SiteID.ToString());
            editUrl = URLHelper.AddParameterToUrl(editUrl, "dialog", QueryHelper.GetString("dialog", "0"));

            URLHelper.Redirect(AddNodeIDParameterToUrl(editUrl));
        }
        else if (actionName.ToLowerCSafe() == "delete")
        {
            SKUInfo sku = SKUInfoProvider.GetSKUInfo(ProductID);
            if (sku == null)
            {
                return;
            }

            if (CheckProductModifyAndRedirect(sku))
            {
                // Delete VolumeDiscountInfo object from database
                VolumeDiscountInfoProvider.DeleteVolumeDiscountInfo(Convert.ToInt32(actionArgument));
            }
        }
    }
    /// <summary>
    /// Initializes the control properties.
    /// </summary>
    protected void SetupControl()
    {
        if (StopProcessing)
        {
            // Do not process
        }
        else
        {
            // Build plugin code
            string src    = "http://platform.linkedin.com/in.js";
            string apiKey = LinkedInHelper.GetLinkedInApiKey(CMSContext.CurrentSiteName);

            // Try to parse product URL
            if (ProductID.ToLowerCSafe().StartsWithCSafe("http"))
            {
                int indexStart = ProductID.LastIndexOfCSafe("-");
                int indexEnd   = ProductID.LastIndexOfCSafe("/");

                if ((indexStart != -1) && (indexEnd != -1))
                {
                    ProductID = ProductID.Substring(indexStart + 1, indexEnd - indexStart - 1);
                }
            }

            string output = "<div style=\"overflow: hidden; width: {0}px;\"><script src=\"{1}\" type=\"text/javascript\">api_key: {5}</script><script type=\"IN/RecommendProduct\" data-company=\"{2}\" data-product=\"{3}\" data-counter=\"{4}\"></script></div>";
            ltlButtonCode.Text = String.Format(output, Width.ToString(), src, CompanyID, ProductID, CountBox, apiKey);
        }
    }
Esempio n. 10
0
 public void mostrarDatos()
 {
     txtCodigo.Text            = ProductID.ToString();
     txtNombredelProducto.Text = ProductName;
     txtPrecio.Text            = UnitPrice.ToString();
     txtStock.Text             = UnitsInStock.ToString();
 }
Esempio n. 11
0
        public override int GetHashCode()
        {
            int hashCode = 0;

            hashCode = hashCode ^ OrderID.GetHashCode() ^ ProductID.GetHashCode();
            return(hashCode);
        }
Esempio n. 12
0
        /// <summary>
        /// Returns if the ProductID is valid (must be a 6-digit and start with 10, 11, 12, or 13)
        /// </summary>
        /// <returns>true if valid</returns>
        public bool Validate()
        {
            string starts = ProductID.ToString().Substring(0, 2);

            return(ProductID.ToString().Length == 6 &&
                   (starts == "10" || starts == "11" || starts == "12" || starts == "13"));
        }
Esempio n. 13
0
        private void RemoveButton_Click(object sender, EventArgs e)
        {
            int ID;

            if (int.TryParse(ProductID.Text, out ID))
            {
                if (_PHPRepo.VerifyProductID(ID))
                {
                    _PHPRepo.GetProductbyId(ID);
                    Product _Product = _PHPRepo.GetProductbyId(ID);
                    _PHPRepo.deleteProduct(_Product);
                    MessageBox.Show("Product has been deleted ", "Sucessful", MessageBoxButtons.OK, MessageBoxIcon.None);
                    StockList.Items.Clear();
                    List <Product> _NewList = _PHPRepo.GetProducts();
                    foreach (Product p in _NewList)
                    {
                        string[] row          = { p.ProductId.ToString(), p.Product_Name.ToString(), p.Price.ToString(), p.Stock_Level.ToString() };
                        var      listViewItem = new ListViewItem(row);
                        StockList.Items.Add(listViewItem);
                    }
                    ;
                    ProductID.Clear();
                }
                else
                {
                    MessageBox.Show("Could not find item: " + ID);
                }
            }
            else
            {
                MessageBox.Show("Please enter a valid ID");
            }
        }
Esempio n. 14
0
        public override int GetHashCode()
        {
            int hashProductID    = ProductID.GetHashCode();
            int hashSerialNumber = SerialNumber.GetHashCode();

            return(hashProductID ^ hashSerialNumber);
        }
Esempio n. 15
0
        public override int GetHashCode()
        {
            int hashCode = 683625434;

            hashCode = hashCode * -1521134295 + PharmacyID.GetHashCode();
            hashCode = hashCode * -1521134295 + ProductID.GetHashCode();
            return(hashCode);
        }
        public override int GetHashCode()
        {
            int hashCode = 13;

            hashCode = (hashCode * 7) + OrderID.GetHashCode();
            hashCode = (hashCode * 7) + ProductID.GetHashCode();
            return(hashCode);
        }
Esempio n. 17
0
 public override string ToString()
 {
     return(string.Concat(new string[] {
         "SupplierID: ", SupplierID.ToString(),
         "ProductID: ", ProductID.ToString(),
         "Date First Supplied: ", DateFirstSupplied.ToString()
     }));
 }
Esempio n. 18
0
 public PressureConfig Get(ProductID pid)
 {
     if (m_HashProductPressure.ContainsKey(pid))
     {
         return(m_HashProductPressure[pid] as PressureConfig);
     }
     return(null);
 }
Esempio n. 19
0
 public override bool Equals(object obj)
 {
     if (obj is Product product)
     {
         return(ProductID.Equals(product.ProductID));
     }
     return(false);
 }
Esempio n. 20
0
 /// <summary>
 /// 设置泵类型
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSetPump_Click(object sender, EventArgs e)
 {
     if (Enum.IsDefined(typeof(ProductID), cbPumpType.Items[cbPumpType.SelectedIndex].ToString()))
     {
         m_ProductID = (ProductID)Enum.Parse(typeof(ProductID), cbPumpType.Items[cbPumpType.SelectedIndex].ToString());
         SetProductID(m_ProductID);
     }
 }
Esempio n. 21
0
        /// <summary>
        /// C9是否通过测试
        /// </summary>
        /// <returns></returns>
        public override bool IsPass()
        {
            CustomProductID cid = ProductIDConvertor.Name2CustomProductID(m_PumpType);

            if (cid == CustomProductID.Unknow)
            {
                Logger.Instance().ErrorFormat("泵类型转换出错,不支持的类型 PumpType ={0}", m_PumpType);
                return(false);
            }
            ProductID pid = ProductIDConvertor.Custom2ProductID(cid);
            Hashtable alarmMetrix = null;
            uint      depletealArmIndex = 0, lowVolArmIndex = 0;      //耗尽和低电压索引
            uint      completeArmIndex = 0, willCompleteArmIndex = 0; //输液结束和输液即将结束
            uint      forgetStartAlarmIndex = 0;                      //遗忘操作

            #region                                                   //查询耗尽、遗忘操作、低电、输液结束和输液即将结束5种类型的报警ID
            switch (pid)
            {
            case ProductID.GrasebyC9:
                alarmMetrix           = AlarmMetrix.Instance().AlarmMetrixC9;
                depletealArmIndex     = 15;
                lowVolArmIndex        = 12;
                completeArmIndex      = 17;
                willCompleteArmIndex  = 14;
                forgetStartAlarmIndex = 13;
                break;

            default:
                break;
            }
            #endregion
            if (depletealArmIndex == 0 ||
                lowVolArmIndex == 0 ||
                completeArmIndex == 0 ||
                willCompleteArmIndex == 0 ||
                forgetStartAlarmIndex == 0
                )
            {
                return(false);
            }
            int findIndex = m_AlarmList.FindIndex((x) =>
            {
                return(x > 0 &&
                       x != depletealArmIndex &&
                       x != lowVolArmIndex &&
                       x != completeArmIndex &&
                       x != willCompleteArmIndex &&
                       x != forgetStartAlarmIndex);
            });
            if (findIndex >= 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Esempio n. 22
0
 public override string ToString()
 {
     return(String.Concat(new string[]
                          { " ProductID:", ProductID.ToString(),
                            " Description ", Description,
                            " Quantity: ", QTY.ToString(),
                            " Unit Price: ", UnitPrice.ToString(),
                            " CategoryID: ", CategoryID.ToString() }));
 }
Esempio n. 23
0
 public override Task <Product> GetProduct(ProductID request, ServerCallContext context)
 {
     return(Task <Product> .Factory.StartNew(() => new Product
     {
         Description = "theory and practice about grpc protocol",
         Name = "gRPC up and running",
         Id = request.Value
     }));
 }
Esempio n. 24
0
 public override string ToString()
 {
     return(String.Concat("Product ID : ", ProductID.ToString(),
                          ", Description : ", Description.ToString(),
                          ", Quanity in Stock : ", QuantityInStock.ToString(),
                          ", Unit Price :", UnitPrice.ToString(),
                          ", Category Id : ", CategoryID.ToString()
                          ));
 }
Esempio n. 25
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="pid">产品ID</param>
 /// <param name="queryInterval">WIFI模块自动上传周期</param>
 public CmdSendPumpType(ProductID pid, ushort queryInterval)
     : base(0x00, 0x02)
 {
     if (pid == ProductID.Graseby1200En)
     {
         pid = ProductID.Graseby1200;
     }
     m_ProductID     = pid;
     m_QueryInterval = queryInterval;
 }
Esempio n. 26
0
 protected override string[] GetContent()
 {
     return(new[]
     {
         ID.ToString(),
         ProductNumber.ToString(),
         ProductID.ToString(),
         ContextID.ToString()
     });
 }
Esempio n. 27
0
        /// <summary>
        /// 添加通道号的原因是由于控制器轮询一次6个串口很费时间,不如指定具体的串口
        /// </summary>
        /// <param name="pid"></param>
        /// <param name="queryInterval"></param>
        /// <param name="remoteSocket"></param>
        /// <param name="func"></param>
        /// <param name="timeoutFunc"></param>
        public void SendPumpType(ProductID pid, ushort queryInterval, AsyncSocketUserToken remoteSocket, EventHandler <EventArgs> func, EventHandler <EventArgs> timeoutFunc, byte channel = 0xFF)
        {
            CmdSendPumpType cmd = new CmdSendPumpType(pid, queryInterval);

            cmd.Channel      = channel;
            cmd.RemoteSocket = remoteSocket;
            long ip = ControllerManager.GetLongIPFromSocket(remoteSocket);

            AddCommand(ip, cmd, func, timeoutFunc);
        }
Esempio n. 28
0
        public override int GetHashCode()
        {
            unchecked
            {
                int hash = 17;
                hash = hash * 23 + ProductID.GetHashCode();

                return(hash);
            }
        }
Esempio n. 29
0
        public void SaveTo(XmlTextWriter xw)
        {
            xw.WriteAttributeString("type", MappedType.ToString());
            xw.WriteAttributeString("source", Source.ToString());
            xw.WriteAttributeString("uuid", UUID.ToString());

            if (Source == SourceType.RawInput)
            {
                xw.WriteAttributeString("vid", VendorID.ToString("X"));
                xw.WriteAttributeString("pid", ProductID.ToString("X"));
                xw.WriteAttributeString("rpt_hash", ReportHash.ToString());
                xw.WriteAttributeString("idx", DeviceIndex.ToString());
            }
            else if (Source == SourceType.XInput)
            {
                xw.WriteAttributeString("idx", DeviceIndex.ToString());
            }
            else if (Source == SourceType.MUNIA)
            {
                xw.WriteAttributeString("devicepath", DevicePath);
            }
            else if (Source == SourceType.Arduino)
            {
                xw.WriteAttributeString("arduino_port", ArduinoPort.Name);
                xw.WriteAttributeString("arduino_type", ArduinoSource.ToString());
            }

            xw.WriteStartElement("buttons");
            foreach (var btn in ButtonMaps)
            {
                btn.SaveTo(xw);
            }
            xw.WriteEndElement();

            xw.WriteStartElement("axes");
            foreach (var axis in AxisMaps)
            {
                axis.SaveTo(xw);
            }
            xw.WriteEndElement();

            xw.WriteStartElement("buttons_to_axis");
            foreach (var btn in ButtonToAxisMaps)
            {
                btn.SaveTo(xw);
            }
            xw.WriteEndElement();

            xw.WriteStartElement("axis_to_buttons");
            foreach (var axis in AxisToButtonMaps)
            {
                axis.SaveTo(xw);
            }
            xw.WriteEndElement();
        }
Esempio n. 30
0
        public override int GetHashCode()
        {
            var hashCode = -2027619230;

            hashCode = hashCode * -1521134295 + ProductID.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(ProductName);

            hashCode = hashCode * -1521134295 + ProductPrice.GetHashCode();
            hashCode = hashCode * -1521134295 + ProductQuantity.GetHashCode();
            return(hashCode);
        }