示例#1
0
 public string Edit(DBConnectionString.Section objSection)
 {
     try
     {
         if (ModelState.IsValid)
         {
             objSection.ModifiedBy = _userStatistics.UserId;
             objSection.ModifiedOn = DateTime.Now;
             if (objSection.Update() > 0)
             {
                 return(Convert.ToString(true));
             }
             return(Convert.ToString(false));
         }
         return(Convert.ToString(false));
     }
     catch (Exception ex)
     {
         return(ex.Message.ToString());
     }
 }
示例#2
0
        public string Create(DBConnectionString.Section section)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    section.CreatedBy  = _userStatistics.UserId;
                    section.InsertedOn = DateTime.Now;
                    if (Convert.ToInt32(section.Insert()) > 0)
                    {
                        return(Convert.ToString(true));
                    }
                    return(Convert.ToString(false));
                }

                return(Convert.ToString(false));
            }
            catch (Exception ex)
            {
                return(ex.Message.ToString());
            }
        }