Beispiel #1
0
        public bool MapMakertoChecker(int MakerID, int CheckerID)
        {
            CM_MAKER_CHECKER_XREF mcx = new CM_MAKER_CHECKER_XREF();

            var count = from n in db.CM_MAKER_CHECKER_XREF
                        where (n.MAKER_ID == MakerID && n.CHECKER_ID == CheckerID)
                        select new { n.RECORD_ID };

            if (count.Count() > 0)
            {
                return(false);
            }
            else
            {
                mcx.MAKER_ID   = MakerID;
                mcx.CHECKER_ID = CheckerID;
                //mcx.CREATED_DATE = DateTime.Now;
                //mcx.CREATED_BY = "Admin";
                //mcx.PARENT_TASK = 1;

                db.CM_MAKER_CHECKER_XREF.Add(mcx);

                db.SaveChanges();

                return(true);
            }
        }
Beispiel #2
0
        public bool DeleteAssignedUsers(decimal RecID)
        {
            CM_MAKER_CHECKER_XREF rpx = new CM_MAKER_CHECKER_XREF();

            try
            {
                CM_MAKER_CHECKER_XREF objDelMakernXCheckerRef = (from MXCRef in db.CM_MAKER_CHECKER_XREF where MXCRef.RECORD_ID == RecID select MXCRef).FirstOrDefault();

                db.CM_MAKER_CHECKER_XREF.Remove(objDelMakernXCheckerRef);
                db.SaveChanges();


                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }