Exemple #1
0
        public List <LableColorEntity> GetLableColor(string clientid, EnumMarkType lableType)
        {
            string tableName = "";

            if (lableType == EnumMarkType.Customer)
            {
                tableName = "CustomerColor";
                if (CustomColor.ContainsKey(clientid))
                {
                    return(CustomColor[clientid]);
                }
            }
            else if (lableType == EnumMarkType.Orders)
            {
                tableName = "OrderColor";
                if (OrderColor.ContainsKey(clientid))
                {
                    return(OrderColor[clientid]);
                }
            }
            else if (lableType == EnumMarkType.Tasks)
            {
                tableName = "TaskColor";
                if (TaskColor.ContainsKey(clientid))
                {
                    return(TaskColor[clientid]);
                }
            }

            List <LableColorEntity> list = new List <LableColorEntity>();
            DataTable dt = LableColorDAL.BaseProvider.GetLableColor(tableName, clientid);

            foreach (DataRow dr in dt.Rows)
            {
                LableColorEntity model = new LableColorEntity();
                model.FillData(dr);
                list.Add(model);
            }

            if (lableType == EnumMarkType.Customer)
            {
                CustomColor.Add(clientid, list);
            }
            else if (lableType == EnumMarkType.Orders)
            {
                OrderColor.Add(clientid, list);
            }
            else if (lableType == EnumMarkType.Tasks)
            {
                TaskColor.Add(clientid, list);
            }
            return(list);
        }
 /// <summary>
 /// Does one tick of color fading for the three colors
 /// </summary>
 /// <param name="mult">-1 or 1, whether adding or subtracting</param>
 private void FadeColor(int mult)
 {
     currentBackgroundColor.Add(mult, rBackInc, gBackInc, bBackInc);
     currentBorderColor.Add(mult, rBordInc, gBordInc, bBordInc);
     currentTextColor.Add(mult, rTextInc, gTextInc, bTextInc);
 }