Example #1
0
        public string GetDeviceProfileDetails(string DeviceId)
        {
            string UseList = null;

            try
            {
                AppLog.WriteErrorLog("Function (GET) : DeviceProfile/GetDeviceProfileDetails");
                UseList = QueryBuilder.GetStr("CONCAT(DeviceMastreId,'-',DeviceName,'-',DeviceNo,'-',IFNULL(RTC,0),'-',IFNULL(Latitude,0),'-',IFNULL(Longitude,0),'-',IFNULL(RPH,0),'-',IFNULL(YPH,0),'-',IFNULL(BPH,0)) AS DeviceDetails",
                                              "devicedetails", " Where DeviceMastreId = '" + DeviceId + "'");
            }
            catch (Exception ex)
            {
                return(Validation.ErrorComman);
            }
            finally
            {
            }
            return(UseList);
        }
Example #2
0
 public string UpdateUser(string PriUserId, string FirstName, string MiddleName, string LastName, string UserId, string Password, string RoleId, string EmailId, string Phone, string IsActive, string ModifiedDate, string ModifiedBy, string PasswordModifiedDate)
 {
     try
     {
         AppLog.WriteErrorLog("Function (POST) : User/UpdateUser");
         if (!Validation.DuplicateUpdateUserId(UserId, PriUserId).Equals("1"))
         {
             return(Validation.ValidDuplicateUserId);
         }
         if (!Validation.DuplicateUpdateEmailId(EmailId, PriUserId).Equals("1"))
         {
             return(Validation.ValidDuplicateEmailId);
         }
         if (!Validation.DuplicateUpdatePhone(Phone, PriUserId).Equals("1"))
         {
             return(Validation.ValidDuplicatePhone);
         }
         string UserName = QueryBuilder.GetStr("UserId", "tblusers", "Where id = '" + PriUserId + "'");
         bool   IsAdd = false; string ReturnVal = Validation.UnsuccessUpdateUser; string ColumnsValues = string.Empty;
         if (!string.IsNullOrEmpty(FirstName))
         {
             ColumnsValues = "FirstName = '" + FirstName + "'";
         }
         if (!string.IsNullOrEmpty(MiddleName))
         {
             ColumnsValues = ColumnsValues + ",MiddleName = '" + MiddleName + "'";
         }
         if (!string.IsNullOrEmpty(LastName))
         {
             ColumnsValues = ColumnsValues + ",LastName = '" + LastName + "'";
         }
         if (!string.IsNullOrEmpty(UserId))
         {
             ColumnsValues = ColumnsValues + ",UserId = '" + UserId + "'";
         }
         if (!string.IsNullOrEmpty(Password))
         {
             ColumnsValues = ColumnsValues + ",Password = '******'";
         }
         if (!string.IsNullOrEmpty(EmailId))
         {
             ColumnsValues = ColumnsValues + ",EmailId = '" + EmailId + "'";
         }
         if (!string.IsNullOrEmpty(Phone))
         {
             ColumnsValues = ColumnsValues + ",Phone = '" + Phone + "'";
         }
         if (!string.IsNullOrEmpty(IsActive))
         {
             ColumnsValues = ColumnsValues + ",IsActive = '" + IsActive + "'";
         }
         if (!string.IsNullOrEmpty(ModifiedDate))
         {
             ColumnsValues = ColumnsValues + ",ModifiedDate = '" + ModifiedDate + "'";
         }
         if (!string.IsNullOrEmpty(ModifiedBy))
         {
             ColumnsValues = ColumnsValues + ",ModifiedBy = '" + ModifiedBy + "'";
         }
         if (!string.IsNullOrEmpty(PasswordModifiedDate))
         {
             ColumnsValues = ColumnsValues + ",PasswordModifiedDate = '" + PasswordModifiedDate + "'";
         }
         if (!string.IsNullOrEmpty(ColumnsValues))
         {
             IsAdd = QueryBuilder.UpdateDB(ColumnsValues, "tblusers", "Where id = '" + PriUserId + "'");
         }
         if (IsAdd)
         {
             string ColumnsValues1 = string.Empty;
             if (!string.IsNullOrEmpty(RoleId))
             {
                 ColumnsValues1 = "RoleId = '" + RoleId + "'";
             }
             if (!string.IsNullOrEmpty(UserId))
             {
                 ColumnsValues1 = ColumnsValues1 + ",UserId = '" + UserId + "'";
             }
             if (!string.IsNullOrEmpty(ColumnsValues1))
             {
                 QueryBuilder.UpdateDB(ColumnsValues1, "tbluserroles", "Where UserId = '" + UserName + "'");
             }
             ReturnVal = Validation.SuccessUpdateUser;
         }
         return(ReturnVal);
     }
     catch
     {
         return(Validation.ErrorComman);
     }
     finally
     {
     }
 }