Ejemplo n.º 1
0
 public bool InsertDrugName(string DrugName)
 {
     var result = new CRUD().getItem(new AmazonDBHelper().AmazonDBConnectionString(), "drugname", DrugName, ":v_drugname", "drugname");
     if (result.Count == 0)
     {
         int ID = 1;
         //Get ID
         List<ListboxHelper.CustomListItem> cli = new ListboxHelper().GetTableID();
         foreach (var li in cli)
         {
             if (li.text == "drugname")
             {
                 ID = li.value;
                 ID += 1;
             }
         }
         List<string> columnName = new List<string>();
         columnName.Add("id");
         columnName.Add("drugname");
         List<string> types = new List<string>();
         types.Add("int");
         types.Add("string");
         List<string> value = new List<string>();
         value.Add(ID.ToString());
         value.Add(DrugName.ToLower());
         new CRUD().InsertItem(new AmazonDBHelper().AmazonDBConnectionString(), "drugname", columnName, types, value);
     }
     return true;
 }
Ejemplo n.º 2
0
 public JsonResult CheckEmail(string Email)
 {
     var client = new Connection().ConnectAmazonDynamoDB(new AmazonDBHelper().AmazonDBConnectionString());
     var result = new CRUD().getItem(new AmazonDBHelper().AmazonDBConnectionString(), "user", Email, ":v_email", "email");
     if (result.Count >= 1)
         return Json("false");
     else
         return Json("true");
 }