Пример #1
0
        public int CreateLableColor(string colorName, string colorValue, string clientid, string userid,
                                    int status = 0, EnumMarkType lableType = EnumMarkType.Customer)
        {
            string procName = "P_InsertCustomerColor";

            if (lableType == EnumMarkType.Orders)
            {
                procName = "P_InsertOrderColor";
            }
            else if (lableType == EnumMarkType.Tasks)
            {
                procName = "P_InsertTaskColor";
            }
            int result = LableColorDAL.BaseProvider.InsertLableColor(procName, colorName, colorValue, clientid, userid, status);

            if (result > 0)
            {
                var list = GetLableColor(clientid, lableType);
                if (list.Where(m => m.ColorID == result).Count() == 0)
                {
                    list.Add(new LableColorEntity()
                    {
                        ColorID      = result,
                        ColorValue   = colorValue,
                        ColorName    = colorName,
                        ClientID     = clientid,
                        CreateUserID = userid,
                        CreateTime   = DateTime.Now,
                        Status       = 0
                    });
                }
            }
            return(result);
        }
Пример #2
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);
        }
Пример #3
0
 static JDFAutoCutMark()
 {
     atrInfoTable[0]  = new AtrInfoTable(AttributeName.MARKTYPE, 0x22222222, AttributeInfo.EnumAttributeType.enumeration, EnumMarkType.getEnum(0), null);
     atrInfoTable[1]  = new AtrInfoTable(AttributeName.POSITION, 0x22222222, AttributeInfo.EnumAttributeType.XYPair, null, null);
     atrInfoTable[2]  = new AtrInfoTable(AttributeName.BLOCKS, 0x33333333, AttributeInfo.EnumAttributeType.NMTOKENS, null, null);
     elemInfoTable[0] = new ElemInfoTable(ElementName.ASSEMBLY, 0x33333333);
 }
Пример #4
0
 ///
 ///          <summary> * (9) get attribute MarkType </summary>
 ///          * <returns> the value of the attribute </returns>
 ///
 public virtual EnumMarkType getMarkType()
 {
     return(EnumMarkType.getEnum(getAttribute(AttributeName.MARKTYPE, null, null)));
 }
Пример #5
0
        // ************************************************************************
        // * Attribute getter / setter
        // * ************************************************************************
        //

        //         ---------------------------------------------------------------------
        //        Methods for Attribute MarkType
        //        ---------------------------------------------------------------------
        ///
        ///          <summary> * (5) set attribute MarkType </summary>
        ///          * <param name="enumVar">: the enumVar to set the attribute to </param>
        ///
        public virtual void setMarkType(EnumMarkType enumVar)
        {
            setAttribute(AttributeName.MARKTYPE, enumVar == null ? null : enumVar.getName(), null);
        }
Пример #6
0
        public int DeleteLableColor(int status, int colorid, string clientid, string updateuserid, EnumMarkType lableType)
        {
            if (ExistLableColor(clientid, (int)lableType, colorid))
            {
                return(2);
            }

            var model = GetLableColorColorID(clientid, colorid, lableType);

            if (model == null)
            {
                return(-200);
            }
            if (CustomColor[clientid].Count == 1)
            {
                return(-100);
            }

            string tableName = "CustomerColor";

            if (lableType == EnumMarkType.Orders)
            {
                tableName = "OrderColor";
            }
            else if (lableType == EnumMarkType.Tasks)
            {
                tableName = "TaskColor";
            }
            bool result = LableColorDAL.BaseProvider.DeleteLableColor(tableName, status, colorid, clientid, updateuserid);

            if (result)
            {
                var list = GetLableColor(clientid, lableType);
                list.Remove(model);
            }
            return(result ? 1 : 0);
        }
Пример #7
0
        public int UpdateLableColor(string clientid, int colorid, string colorName, string colorValue, string updateuserid, EnumMarkType lableType)
        {
            string tableName = "CustomerColor";

            if (lableType == EnumMarkType.Orders)
            {
                tableName = "OrderColor";
            }
            else if (lableType == EnumMarkType.Tasks)
            {
                tableName = "TaskColor";
            }
            bool result = LableColorDAL.BaseProvider.UpdateLableColor(tableName, clientid, colorid, colorName, colorValue, updateuserid);

            if (result)
            {
                var model = GetLableColorColorID(clientid, colorid, lableType);
                model.ColorValue = colorValue;
                model.ColorName  = colorName;
            }
            return(result ? 1 : 0);
        }
Пример #8
0
        public LableColorEntity GetLableColorColorID(string clientid, int colorid, EnumMarkType markType)
        {
            var list = GetLableColor(clientid, markType);

            return(list.Where(x => x.Status != 9 && x.ColorID == colorid).FirstOrDefault());
        }