Ejemplo n.º 1
0
        public DataSet AddUserProfile(UserProfileBo userprofileBo)
        {
            var     transactionStatus = new TransactionStatus();
            var     userprofile       = BuiltUserProfileDomain(userprofileBo);
            string  sbc = DESEncrypt(userprofile.Pswd);
            CemexDb con = new CemexDb();

            SqlParameter[] Params =
            {
                new SqlParameter("@opReturnValue", SqlDbType.Int),           //0
                new SqlParameter("@authority_Id", userprofile.Authority_Id), //0
                new SqlParameter("@user_Name", userprofile.User_Name),       //3
                new SqlParameter("@firstname", userprofile.Firstname),       //4
                new SqlParameter("@lastname", userprofile.Lastname),         //5
                new SqlParameter("@pswd", DESEncrypt(userprofile.Pswd)),     //6
                new SqlParameter("@activated_By", "admin"),                  //7
                new SqlParameter("@department", "LMK"),                      //8
                new SqlParameter("@created_On", System.DateTime.Now),        //9
                new SqlParameter("@modified_On", System.DateTime.Now),       //10
                new SqlParameter("@pswd_Reset_On", System.DateTime.Now),     //11
                new SqlParameter("@UserType", userprofile.UserType),         //12
            };
            Params[0].Direction = ParameterDirection.Output;
            DataSet ds = SqlHelper.ExecuteDataset(con.GetConnection(), CommandType.StoredProcedure, "proc_AddUserProfile", Params);

            ds.Locale = CultureInfo.InvariantCulture;

            return(ds);
        }
Ejemplo n.º 2
0
        public TransactionStatus UpdateUserProfile(UserProfileBo userprofileBo)
        {
            CemexDb con = new CemexDb();

            SqlParameter[] Params1 =
            {
                //  new SqlParameter("@Authority_Id",AuthId),//10 @
                new SqlParameter("@user_Id", userprofileBo.User_Id),    //10 @
                //  new SqlParameter("@PropId",PropId),//10 @
            };

            DataSet ds1    = SqlHelper.ExecuteDataset(con.GetConnection(), CommandType.StoredProcedure, "proc_GetUserPwsd", Params1);
            string  oldpwd = ds1.Tables[0].Rows[0][0].ToString();

            //  return ds;
            var transactionStatus = new TransactionStatus();
            var userprofile       = BuiltUserProfileDomain(userprofileBo);

            if (oldpwd == userprofile.Pswd)
            {
                oldPassword = userprofile.Pswd;
            }
            else
            {
                oldPassword = DESEncrypt(userprofile.Pswd);
            }
            //  string abc = DESEncrypt(userprofile.Pswd);
            // CemexDb con = new CemexDb();
            SqlParameter[] Params =
            {
                new SqlParameter("@opReturnValue", SqlDbType.Int),           //12
                new SqlParameter("@user_Id", userprofile.User_Id),           //0
                new SqlParameter("@authority_Id", userprofile.Authority_Id), //0

                new SqlParameter("@user_Name", userprofile.User_Name),       //3
                new SqlParameter("@firstname", userprofile.Firstname),       //4
                new SqlParameter("@lastname", userprofile.Lastname),         //5
                new SqlParameter("@pswd", oldPassword),                      //6
                new SqlParameter("@activated_By", "admin"),                  //7
                new SqlParameter("@department", "LMK"),                      //8

                new SqlParameter("@modified_On", System.DateTime.Now),       //10
                new SqlParameter("@pswd_Reset_On", System.DateTime.Now)      //11
            };

            Params[0].Direction = ParameterDirection.Output;
            DataSet ds = SqlHelper.ExecuteDataset(con.GetConnection(), CommandType.StoredProcedure, "proc_UpdateUserProfile", Params);

            ds.Locale = CultureInfo.InvariantCulture;

            return(transactionStatus);
        }
Ejemplo n.º 3
0
 private UserProfile BuiltUserProfileDomain(UserProfileBo userprofileBo)
 {
     return((UserProfile) new UserProfile().InjectFrom(userprofileBo));
 }