コード例 #1
0
ファイル: StandardMaster.cs プロジェクト: Viveks775/SchoolERP
        public object DeleteStandard(StandardParam StdParam)
        {
            Tbl_StandardMaster obj = new Tbl_StandardMaster();

            if (StdParam.Status == 0)
            {
                obj        = db.Tbl_StandardMaster.SingleOrDefault(r => r.StandardId == StdParam.StandardId);
                obj.Status = 1;
                db.SaveChanges();


                return(new Result()
                {
                    IsSucess = true, ResultData = "Standard Activeted Successfully"
                });
            }
            else
            {
                obj        = db.Tbl_StandardMaster.SingleOrDefault(r => r.StandardId == StdParam.StandardId);
                obj.Status = 0;
                db.SaveChanges();


                return(new Result()
                {
                    IsSucess = true, ResultData = "Standard Dectiveted Successfully"
                });
            }
        }
コード例 #2
0
        public object UpdateStandard([FromBody] StandardParam StdParam)
        {
            StandardMaster Edit = new StandardMaster();

            var result = Edit.UpdateStandard(StdParam);

            return(result);
        }
コード例 #3
0
        public object DeleteStandard([FromBody] StandardParam StdParam)
        {
            StandardMaster Delete = new StandardMaster();

            var result = Delete.DeleteStandard(StdParam);

            return(result);
        }
コード例 #4
0
        public object GetSingleStandard([FromBody] StandardParam StdParam)
        {
            StandardMaster obj = new StandardMaster();

            var result = obj.GetSingleStandard(StdParam);

            return(result);
        }
コード例 #5
0
        public object DisplayStandard([FromBody] StandardParam StdParam)
        {
            StandardMaster Save = new StandardMaster();

            var result = Save.GetStandardInfo(StdParam);

            return(result);
        }
コード例 #6
0
        public object SaveStandard([FromBody] StandardParam StdParam)
        {
            StandardMaster Save = new StandardMaster();

            var result = Save.AddStandard(StdParam);

            return(result);
        }
コード例 #7
0
ファイル: StandardMaster.cs プロジェクト: Viveks775/SchoolERP
        public object GetSingleStandard(StandardParam StdParam)
        {
            var Standard = db.Tbl_StandardMaster.SingleOrDefault(r => r.StandardId == StdParam.StandardId && r.Status == 1);


            return(new Result()
            {
                IsSucess = true, ResultData = Standard
            });
        }
コード例 #8
0
ファイル: StandardMaster.cs プロジェクト: Viveks775/SchoolERP
        public object UpdateStandard(StandardParam StdParam)
        {
            Tbl_StandardMaster obj = db.Tbl_StandardMaster.SingleOrDefault(r => r.StandardId == StdParam.StandardId);

            obj.StandardName = StdParam.StandardName;
            obj.ModifiedBy   = 1;
            obj.ModifiedDate = DateTime.Now;
            db.SaveChanges();
            return(new Result()
            {
                IsSucess = true, ResultData = "Standard Updated Successfully"
            });
        }
コード例 #9
0
ファイル: StandardMaster.cs プロジェクト: Viveks775/SchoolERP
        public object GetStandardInfo(StandardParam StdParam)
        {
            List <ViewDisplayStandard> result = null;

            if (StdParam.Status == 0)
            {
                result = db.ViewDisplayStandards.Where(r => r.Status == 0).ToList();
            }
            else
            {
                result = db.ViewDisplayStandards.Where(r => r.Status == 1).ToList();
            }

            // return new Result() { IsSucess = true, ResultData = result };
            return(result);
        }
コード例 #10
0
ファイル: StandardMaster.cs プロジェクト: Viveks775/SchoolERP
        public object AddStandard(StandardParam StdParam)
        {
            Tbl_StandardMaster obj = new Tbl_StandardMaster();

            obj.StandardName = StdParam.StandardName;
            obj.Status       = 1;
            obj.CreatedBy    = 1;
            obj.CreatedDate  = System.DateTime.Today.Date;
            obj.ModifiedBy   = null;
            obj.ModifiedDate = null;
            db.Tbl_StandardMaster.Add(obj);
            db.SaveChanges();
            return(new Result()
            {
                IsSucess = true, ResultData = "Standard Save Successfully"
            });
        }
コード例 #11
0
        public object UpdateStandard(StandardParam StdParam)
        {
            var Data = db.Tbl_StandardMaster.Where(r => r.StandardName == StdParam.StandardName).FirstOrDefault();

            if (Data == null)
            {
                return(new Error()
                {
                    IsError = true, Message = "Duplicate Entry Not Allowed"
                });
            }
            Tbl_StandardMaster obj = db.Tbl_StandardMaster.SingleOrDefault(r => r.StandardId == StdParam.StandardId);

            obj.StandardName = StdParam.StandardName;
            obj.ModifiedBy   = 1;
            obj.ModifiedDate = DateTime.Now;
            db.SaveChanges();
            return(new Result()
            {
                IsSucess = true, ResultData = "Standard Updated Successfully"
            });
        }