Ejemplo n.º 1
0
        public bool SP_PERSON_RETIRE_UPD
        (
            string ppr_person_code
            , string ptitle_code
            , string pperson_thai_name
            , string pperson_thai_surname
            , string pperson_id
            , string pc_active
            , string pc_updated_by
            , string pperson_password
            , string pperson_email
            , ref string strMessage
        )
        {
            bool           blnResult = false;
            SqlConnection  oConn     = new SqlConnection();
            SqlCommand     oCommand  = new SqlCommand();
            SqlDataAdapter oAdapter  = new SqlDataAdapter();

            try
            {
                oConn.ConnectionString = _strConn;
                oConn.Open();
                oCommand.Connection  = oConn;
                oCommand.CommandType = CommandType.StoredProcedure;
                oCommand.CommandText = "sp_PERSON_RETIRE_UPD";
                oCommand.Parameters.Add("pr_person_code", SqlDbType.VarChar).Value      = ppr_person_code;
                oCommand.Parameters.Add("title_code", SqlDbType.VarChar).Value          = ptitle_code;
                oCommand.Parameters.Add("person_thai_name", SqlDbType.VarChar).Value    = pperson_thai_name;
                oCommand.Parameters.Add("person_thai_surname", SqlDbType.VarChar).Value = pperson_thai_surname;
                oCommand.Parameters.Add("person_id", SqlDbType.VarChar).Value           = pperson_id;
                oCommand.Parameters.Add("c_active", SqlDbType.VarChar).Value            = pc_active;
                oCommand.Parameters.Add("c_updated_by", SqlDbType.VarChar).Value        = pc_updated_by;
                oCommand.Parameters.Add("person_password", SqlDbType.VarChar).Value     = Cryptorengine.Encrypt(pperson_password, true);
                oCommand.Parameters.Add("person_email", SqlDbType.VarChar).Value        = pperson_email;
                // - - - - - - - - - - - -
                oCommand.ExecuteNonQuery();
                blnResult = true;
            }
            catch (Exception ex)
            {
                strMessage = ex.Message.ToString();
            }
            finally
            {
                oConn.Close();
                oCommand.Dispose();
                oConn.Dispose();
            }
            return(blnResult);
        }
Ejemplo n.º 2
0
        public bool SP_USER_UPD(
            string pUserID,
            string pperson_code,
            string pLoginName,
            string pPassword,
            string pEmail,
            string puser_group_code,
            string pStatus,
            string pRemark,
            string pc_updated_by,
            string pbudget_type,
            ref string strMessage)
        {
            bool           blnResult = false;
            SqlConnection  oConn     = new SqlConnection();
            SqlCommand     oCommand  = new SqlCommand();
            SqlDataAdapter oAdapter  = new SqlDataAdapter();

            try
            {
                oConn.ConnectionString = _strConn;
                oConn.Open();
                oCommand.Connection  = oConn;
                oCommand.CommandType = CommandType.StoredProcedure;
                oCommand.CommandText = "sp_USER_UPD";
                oCommand.Parameters.Add("puserID", SqlDbType.Int).Value              = pUserID;
                oCommand.Parameters.Add("pperson_code", SqlDbType.VarChar).Value     = pperson_code;
                oCommand.Parameters.Add("ploginname", SqlDbType.VarChar).Value       = pLoginName;
                oCommand.Parameters.Add("ppassword", SqlDbType.VarChar).Value        = Cryptorengine.Encrypt(pPassword, true);
                oCommand.Parameters.Add("pemail", SqlDbType.VarChar).Value           = pEmail;
                oCommand.Parameters.Add("puser_group_code", SqlDbType.VarChar).Value = puser_group_code;
                oCommand.Parameters.Add("pStatus", SqlDbType.VarChar).Value          = pStatus;
                oCommand.Parameters.Add("pRemark", SqlDbType.VarChar).Value          = pRemark;
                oCommand.Parameters.Add("pUpdatedBy", SqlDbType.VarChar).Value       = pc_updated_by;
                oCommand.Parameters.Add("budget_type", SqlDbType.VarChar).Value      = pbudget_type;
                // - - - - - - - - - - - -
                oCommand.ExecuteNonQuery();
                blnResult = true;
            }
            catch (Exception ex)
            {
                strMessage = ex.Message.ToString();
            }
            finally
            {
                oConn.Close();
                oCommand.Dispose();
                oConn.Dispose();
            }
            return(blnResult);
        }