Beispiel #1
0
        public string saveuom(uom uomobject)
        {
            uomclass uomsrc = new uomclass();
            string   result = string.Empty;

            if (uomobject.UOMID != 0)
            {
                //update
                var check = getuoms()
                            .Where(c => c.UOMID != uomobject.UOMID)
                            .Where(c => c.UOMName == uomobject.UOMName)
                            .Where(c => c.IsDeleted == false)
                            .FirstOrDefault();

                if (check != null)
                {
                    result = "UOM TAKEN";
                }
                else
                {
                    var obj = uomsrc.saveuom(uomobject);
                    if (obj != null)
                    {
                        result = "Success";
                    }
                }
            }
            else
            {
                var check = getuoms()
                            .Where(c => c.UOMName == uomobject.UOMName)
                            .Where(c => c.IsDeleted == false)
                            .FirstOrDefault();
                if (check != null)
                {
                    result = "UOM TAKEN";
                }
                else
                {
                    var obj = uomsrc.saveuom(uomobject);
                    if (obj != null)
                    {
                        result = "Success";
                    }
                }
            }

            return(result);
        }
Beispiel #2
0
        public List <uom> getuoms()
        {
            uomclass uomsrc = new uomclass();

            return(uomsrc.getuoms());
        }