Exemple #1
0
 public void SavePublicDesign(gPrivateFormModel model, int officeId)
 {
     using (var db = new LTCDataModel.PetaPoco.Database(DbConfiguration.LtcForm))
     {
         int fid = model.FormID;
         gPublicFormModel found = db.Fetch <gPublicFormModel>($"select * from form_public where FormID={fid}").FirstOrDefault();
         if (found != null)
         {
             found.Description  = model.Description;
             found.SystemDate   = DateTime.Now;
             found.Content      = model.Content;
             found.IsActive     = 1;
             found.IsSurveyForm = 0;
             db.Update(found, fid);
         }
         else
         {
             //Save Form Design Object
             gPublicFormModel design = new gPublicFormModel();
             design.Description  = model.Description;
             design.SystemDate   = DateTime.Now;
             design.Content      = model.Content;
             design.IsActive     = 1;
             design.IsSurveyForm = 0;
             db.Save(design);
         }
     }
 }
Exemple #2
0
 public string SaveFormAnswer(gFormSavedModel model)
 {
     if (!IsFormAlreadyExist(model))
     {
         var db = new LTCDataModel.PetaPoco.Database(DbConfiguration.LtcForm);
         model.SystemDate = DateTime.Now;
         db.Save(model);
         return("Form Saved Succefully");
     }
     return("Form Already Exists");
 }
Exemple #3
0
 public void SavePrivateTag(gFormPrivateTag model)
 {
     using (var db = new LTCDataModel.PetaPoco.Database(DbConfiguration.LtcForm))
     {
         gFormPrivateTag found = db.Fetch <gFormPrivateTag>($"select * from form_tag_private where TagID={model.TagID}").FirstOrDefault();
         if (found != null)
         {
             db.Update(model, model.TagID);
         }
         else
         {
             db.Save(model);
         }
     }
 }
Exemple #4
0
 public void SavePublicTag(gPublicTagModel model)
 {
     model.IsSurveyForm = 1;
     using (var db = new LTCDataModel.PetaPoco.Database(DbConfiguration.LtcForm))
     {
         gPublicTagModel found = db.Fetch <gPublicTagModel>($"select * from form_tag_public where TagID={model.TagID} ").FirstOrDefault();
         if (found != null)
         {
             db.Update(model, model.TagID);
         }
         else
         {
             db.Save(model);
         }
     }
 }