Esempio n. 1
0
 public string Edit(FormDataCollection form)
 {
     var retVal = string.Empty;
     var operation = form.Get("oper");
     var id = ConvertHelper.ToInt32(form.Get("Id").Split(',')[0]);
     WebServiceConfigInfo info;
     switch (operation)
     {
         case "edit":
             info = WebServiceConfigRepository.GetInfo(id);
             if (info != null)
             {
                 info.Value = form.Get("Value");
                 info.Type = form.Get("Type").ToInt32();
                 info.BranchId = form.Get("BranchId").ToInt32();
                 WebServiceConfigRepository.Update(info);
             }
             break;
         case "add":
             info = new WebServiceConfigInfo
             {
                 Value = form.Get("Value"),
                 Type = form.Get("Type").ToInt32(),
                 BranchId = form.Get("BranchId").ToInt32(),
             };
             WebServiceConfigRepository.Create(info);
             break;
         case "del":
             WebServiceConfigRepository.Delete(id);
             break;
     }
     StoreData.ListWebServiceConfig = WebServiceConfigRepository.GetAll();
     return retVal;
 }
Esempio n. 2
0
 public static void Update(WebServiceConfigInfo info)
 {
     DataProvider.Instance().WebServiceConfig_Update(info.Id, info.BranchId, info.Type, info.Value);
 }
Esempio n. 3
0
 public static int Create(WebServiceConfigInfo info)
 {
     return DataProvider.Instance().WebServiceConfig_Insert(info.BranchId, info.Type, info.Value);
 }