示例#1
0
            /// <summary>
            /// Update State Fields To Specific Provider ID
            /// </summary>
            /// <param name="ProviderID">Provider ID</param>
            /// <param name="state">Active Or Disable</param>
            /// <returns>ProviderID</returns>
            public static Tuple <ErrorObject, string> ProviderDisable(int ProviderID, string state)
            {
                erros = new ErrorObject();
                try
                {
                    using (HSCMEntities db = new HSCMEntities())
                    {
                        var row = db.tblProvider.Single(p => p.id == ProviderID);
                        row.state      = state;
                        row.deleteDate = DateTime.Now;
                        result         = db.SaveChanges();

                        Message     = "Affected Row: " + result.ToString();
                        erros.Error = false;
                        return(new Tuple <ErrorObject, string>(erros.IfError(false), Message));
                    }
                }
                catch (Exception ex)
                {
                    erros.InfoError(ex);
                    return(new Tuple <ErrorObject, string>(erros, String.Empty));
                }
            }
示例#2
0
 /// <summary>
 /// Return True Or False If Container Child
 /// </summary>
 /// <param name="id">Category ID</param>
 /// <returns>True Or False If Container Child</returns>
 public static Tuple <ErrorObject, bool> ContainerChild(int CategoryID)
 {
     erros = new ErrorObject();
     try
     {
         using (EileenGaldamezEntities db = new EileenGaldamezEntities())
         {
             var algo = db.tblCategory.Where(ty => ty.idCategory == CategoryID).ToList();
             if (algo.Count > 0)
             {
                 return(new Tuple <ErrorObject, bool>(erros, true));
             }
             else
             {
                 return(new Tuple <ErrorObject, bool>(erros, false));
             }
         }
     }
     catch (Exception ex)
     {
         erros.InfoError(ex);
         return(new Tuple <ErrorObject, bool>(erros, false));
     }
 }
            /// <summary>
            /// Update Cellar Area Information
            /// </summary>
            /// <param name="data">Cellar Area Information</param>
            /// <returns>Number Affected Row</returns>
            public static Tuple <ErrorObject, string> CellarArea(tblCellarArea data)
            {
                erros = new ErrorObject();
                try
                {
                    using (EileenGaldamezEntities db = new EileenGaldamezEntities())
                    {
                        var row = db.tblCellarArea.Single(p => p.id == data.id);
                        row.name       = data.name;
                        row.detail     = data.detail;
                        row.upDateDate = data.upDateDate;
                        result         = db.SaveChanges();

                        Message     = "Affected Row: " + result.ToString();
                        erros.Error = false;
                        return(new Tuple <ErrorObject, string>(erros.IfError(false), Message));
                    }
                }
                catch (Exception ex)
                {
                    erros.InfoError(ex);
                    return(new Tuple <ErrorObject, string>(erros, String.Empty));
                }
            }