コード例 #1
0
        public bool UpdateNumber(Common.GeneralNumber generalNumber, Guid userGuid, Business.CheckNumberScope scope)
        {
            try
            {
                if (!IsDuplicateNumber(userGuid, generalNumber.GeneralPhoneBookGuid, scope, generalNumber.CellPhone))
                {
                    throw new Exception(Language.GetString("ErrorDuplicateNumber"));
                }

                return(base.ExecuteSPCommand("UpdateNumber", "@Guid", generalNumber.GeneralNumberGuid,
                                             "@FirstName", generalNumber.FirstName,
                                             "@LastName", generalNumber.LastName,
                                             "@BirthDate", generalNumber.BirthDate,
                                             "@Telephone", generalNumber.Telephone,
                                             "@CellPhone", generalNumber.CellPhone,
                                             "@FaxNumber", generalNumber.FaxNumber,
                                             "@Job", generalNumber.Job,
                                             "@Address", generalNumber.Address,
                                             "@Email", generalNumber.Email,
                                             "@Sex", generalNumber.Sex));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
        public bool InsertNumber(Common.GeneralNumber generalNumber)
        {
            Guid guid = Guid.NewGuid();

            return(base.ExecuteSPCommand("InsertNumber", "@Guid", guid,
                                         "@FirstName", generalNumber.FirstName,
                                         "@LastName", generalNumber.LastName,
                                         "@BirthDate", generalNumber.BirthDate,
                                         "@Telephone", generalNumber.Telephone,
                                         "@CellPhone", generalNumber.CellPhone,
                                         "@FaxNumber", generalNumber.FaxNumber,
                                         "@Job", generalNumber.Job,
                                         "@Address", generalNumber.Address,
                                         "@Email", generalNumber.Email,
                                         "@CreateDate", generalNumber.CreateDate,
                                         "@Sex", generalNumber.Sex,
                                         "@GeneralPhoneBookGuid", generalNumber.GeneralPhoneBookGuid));
        }
コード例 #3
0
        public Common.GeneralNumber LoadNumber(Guid numberGuid)
        {
            Common.GeneralNumber generalNumber = new Common.GeneralNumber();
            DataRow dataRowNumberInfo          = base.FetchDataTable("SELECT * FROM [GeneralNumbers] WHERE [IsDeleted]=0 AND [Guid]=@Guid", "@Guid", numberGuid).Rows[0];

            generalNumber.FirstName = Helper.GetString(dataRowNumberInfo["FirstName"]);
            generalNumber.LastName  = Helper.GetString(dataRowNumberInfo["LastName"]);
            generalNumber.BirthDate = Helper.GetDateTime(dataRowNumberInfo["Birthdate"].ToString());
            generalNumber.Telephone = Helper.GetString(dataRowNumberInfo["Telephone"]);
            generalNumber.CellPhone = Helper.GetString(dataRowNumberInfo["CellPhone"]);
            generalNumber.FaxNumber = Helper.GetString(dataRowNumberInfo["FaxNumber"]);
            generalNumber.Job       = Helper.GetString(dataRowNumberInfo["Job"]);
            generalNumber.Address   = Helper.GetString(dataRowNumberInfo["Address"]);
            generalNumber.Email     = Helper.GetString(dataRowNumberInfo["Email"]);

            if (!Helper.CheckDataConditions(dataRowNumberInfo["Sex"]).IsEmpty)
            {
                generalNumber.Sex = Helper.GetInt(dataRowNumberInfo["Sex"]);
            }
            return(generalNumber);
        }
コード例 #4
0
        public DataTable GetPagedNumbers(Common.GeneralNumber generalNumber, string sortField, int pageNo, int pageSize, ref int resultCount)
        {
            DataSet numbersInfo = base.FetchSPDataSet("GetPagedNumbers",
                                                      "@GeneralPhoneBookGuid", generalNumber.GeneralPhoneBookGuid,
                                                      "@FirstName", generalNumber.FirstName,
                                                      "@LastName", generalNumber.LastName,
                                                      "@BirthDate", generalNumber.BirthDate,
                                                      "@Sex", generalNumber.Sex,
                                                      "@CellPhone", generalNumber.CellPhone,
                                                      "@Email", generalNumber.Email,
                                                      "@Job", generalNumber.Job,
                                                      "@Telephone", generalNumber.Telephone,
                                                      "@FaxNumber", generalNumber.FaxNumber,
                                                      "@Address", generalNumber.Address,
                                                      "@PageNo", pageNo,
                                                      "@PageSize", pageSize,
                                                      "@SortField", sortField);

            resultCount = Helper.GetInt(numbersInfo.Tables[0].Rows[0]["RowCount"]);
            return(numbersInfo.Tables[1]);
        }