コード例 #1
0
 public object AddInstitute([FromBody] InstituteParam obj)
 {
     try
     {
         InstituteBusiness save = new InstituteBusiness();
         var result             = save.SaveInstitute(obj);
         return(result);
     }
     catch (Exception e)
     {
         return(new Error()
         {
             IsError = true, Message = e.Message
         });
     }
 }
コード例 #2
0
 public object SaveInstitute(InstituteParam obj)
 {
     try
     {
         Tbl_Institute_Master objinst = new Tbl_Institute_Master();
         objinst.AffilationNo              = obj.AffilationNo;
         objinst.BoardId                   = obj.BoardId;
         objinst.InstituteName             = obj.InstituteName;
         objinst.EstablishedYear           = obj.EstablishedYear;
         objinst.InstituteOrganizationName = obj.InstituteOrganizationName;
         //objinst.InstituteRecognitionNoPrimary = obj.InstituteRecognitionNoPrimary;
         objinst.OrganizationAddress        = obj.OrganizationAddress;
         objinst.OrganizationRegistrationNo = obj.OrganizationRegistrationNo;
         //objinst.RegistrationCertificateNo = obj.RegistrationCertificateNo;
         objinst.SectionId  = obj.SectionId;
         objinst.UdiseNo    = obj.UdiseNo;
         objinst.CreatedId  = obj.CreatedId;
         objinst.CreatedOn  = System.DateTime.Now.Date;
         objinst.ModifiedId = obj.ModifiedId;
         objinst.ModifiedOn = null;
         objinst.Status     = 1;
         db.Tbl_Institute_Master.Add(objinst);
         db.SaveChanges();
         return(new Result()
         {
             IsSucess = true, ResultData = "Created Institute"
         });
     }
     catch (Exception E)
     {
         return(new Error()
         {
             IsError = true, Message = E.Message
         });
     }
 }