//public static string GetUserSmsFormats(Guid userGuid, bool showCheckBox) //{ // StringBuilder tree = new StringBuilder(); // StringBuilder phonebook = new StringBuilder(); // List<DataRow> lstUserFormat = new List<DataRow>(); // List<string> lstFormat = new List<string>(); // Business.SmsFormat SmsFormatController = new Business.SmsFormat(); // Common.User user = Facade.User.LoadUser(userGuid); // DataTable dataTableFormats = SmsFormatController.GetFormatOfPhoneBook(user.IsAdmin, user.UserGuid); // lstUserFormat = dataTableFormats.AsEnumerable().ToList(); // tree.Append("<div class='myList'><ul class='browser filetree'>"); // foreach (DataRow row in lstUserFormat) // { // phonebook.Clear(); // if (!lstFormat.Contains(row["FormatGuid"].ToString())) // { // lstFormat.Add(row["FormatGuid"].ToString()); // List<DataRow> lstPhoneBooks = lstUserFormat.Where(format => Helper.GetGuid(format["FormatGuid"]) == Helper.GetGuid(row["FormatGuid"])).ToList(); // foreach (DataRow phoneBookRow in lstPhoneBooks) // { // phonebook.Append(string.Format("<li><span class='folder' Type='group' PhoneBookGuid='{0}'>{1}{2}</span></li>", // phoneBookRow["PhoneBookGuid"], // showCheckBox ? "<input onclick='checkBoxControlChecked(this);' type='checkbox'/>" : string.Empty, // phoneBookRow["PhoneBookName"])); // } // tree.Append(string.Format("<li><span class='root folder' Type='format' FormatGuid='{0}'>{1}{2}</span>{3}</li>", // row["FormatGuid"], // showCheckBox ? "<input onclick='checkBoxControlChecked(this);' type='checkbox'/>" : string.Empty, // row["FormatName"], // phonebook.Length > 0 ? "<ul>" + phonebook.ToString() + "</ul>" : "")); // } // } // tree.Append("</ul></div>"); // return tree.ToString(); //} public static Common.SmsFormat LoadFormat(Guid smsFormatGuid) { Business.SmsFormat smsFormatController = new Business.SmsFormat(); Common.SmsFormat smsFormat = new Common.SmsFormat(); smsFormatController.Load(smsFormatGuid, smsFormat); return(smsFormat); }
public bool UpdateFormat(Common.SmsFormat smsFormat) { return(base.ExecuteSPCommand("UpdateFormat", "@Guid", smsFormat.SmsFormatGuid, "@Name", smsFormat.Name, "@Format", smsFormat.Format)); }
public static bool InsertFormatForGroups(Common.SmsFormat smsFormat) { Business.SmsFormat smsFormatController = new Business.SmsFormat(); try { if (smsFormatController.InsertFormat(smsFormat) == Guid.Empty) { throw new Exception(Language.GetString("ErrorRecord")); } return(true); } catch { return(false); } }
public Guid InsertFormat(Common.SmsFormat smsFormat) { Guid guid = Guid.NewGuid(); try { base.ExecuteSPCommand("InsertFormat", "@Guid", guid, "@Name", smsFormat.Name, "@Format", smsFormat.Format, "@CreateDate", smsFormat.CreateDate, "@PhoneBookGuid", smsFormat.PhoneBookGuid); return(guid); } catch { guid = Guid.Empty; return(guid); } }